Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 14, 2020

Conversation

jdconrad
Copy link
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
Collaborator

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

@jdconrad
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/default-distro

@jdconrad
Copy link
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