Skip to content

Remove AStoreable as an extendable node from the Painless user tree#54969

Merged
jdconrad merged 11 commits intoelastic:masterfrom
jdconrad:nodes1
Apr 14, 2020
Merged

Remove AStoreable as an extendable node from the Painless user tree#54969
jdconrad merged 11 commits intoelastic:masterfrom
jdconrad:nodes1

Conversation

@jdconrad
Copy link
Copy Markdown
Contributor

@jdconrad jdconrad commented Apr 8, 2020

This change removes the extendable AStoreable node from the Painless user tree. AStoreable was used to determine if a node was allowed to store a value. However, this was fragile and inflexible as the instanceof check was only 1-level deep so nodes still could throw errors under certain circumstances. This has been replaced by an expression input "write" to tell an expression node whether or not it is meant to store a value. This allows expressions nodes to determine the best course of action when asked to store a value and also gives better error messaging.

This also makes isDefOptimized an output of an expression as opposed to a mutable value on an expression. This is used to determine if a def method returning a value can change the returned value as part of the method signature as opposed to an extra cast.

@jdconrad jdconrad added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring v8.0.0 labels Apr 8, 2020
@jdconrad jdconrad requested review from rjernst and stu-elastic April 8, 2020 17:23
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Scripting)

@jdconrad
Copy link
Copy Markdown
Contributor Author

@elasticmachine run elasticsearch-ci/default-distro

@jdconrad
Copy link
Copy Markdown
Contributor Author

@stu-elastic Thanks for the review!

@jdconrad jdconrad merged commit df1c0be into elastic:master Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants