Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Working with type properties for #8322, I encountered issues when setting the name of something stored in a variable (unknown/object type). Specifically, PropertyBaseCondition determines that the valid change types are String and Component (some names are strings, others are components). At runtime, with the type of the stored value known, it is able to perform the change. However, if the runtime accepted change types differ from those provided at parse time, there is a silent failure. Additionally, the existing logic for verifying correct types is incorrect. It assumes, for arrays, that
deltawill be correctly typed. However, unlikegetArrayorgetAll, there are no guarantees about the type of delta arrays.Another issue exists with the implementation of PropCondContains, which fails to correctly convert inputs at runtime.
Solution
I have reworked the change logic in
PropertyBaseExpressionto verify each individual object within delta against a flattened list of allowed change types. If any values are unable to be verified, there is an additional stage that now converts delta values. If any values fail to convert, the change operation is abandoned.PropCondContains already has logic for converting the
needlesexpression. It works as expected during parse time. However, it was forgotten to update the field to instead store the converted needles. Thus, there were silent failures at runtime.Testing Completed
I have confirmed that the failing tests in #8322 now pass. Additionally, I have added a regression test for the contains issue.
Supporting Information
n/a
Completes: none
Related: none
AI assistance: none