Copilot commented on code in PR #7312:
URL: https://github.com/apache/incubator-kie/pull/7312#discussion_r4641062362


##########
drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/Consequence.java:
##########
@@ -537,11 +537,30 @@ private static boolean hasDroolsAsParameter( 
MethodCallExpr mce ) {
     }
 
     private static boolean hasDroolsScope( MethodCallExpr mce ) {
+        if (mce.findFirst(ArrayAccessExpr.class).isPresent()) {
+            // DrlxParseUtil.findRootNodeViaScope() rejects array access in 
the scope chain
+            return isNameExprWithName(findRootThroughArrayAccess(mce), 
"drools");

Review Comment:
   A standalone `Color.values()[1].name();` followed by `update($p);` still 
fails compilation when `$p` is property-reactive. It passes this new check, but 
`findModifiedProperties()` later sends the standalone call to 
`DrlxParseUtil.findRemoveRootNodeViaScope()`, which still throws on array 
access. Make that property-mask traversal array-aware too, and add a regression 
test combining a standalone indexed call with an update.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to