blackdrag commented on code in PR #3058:
URL: https://github.com/apache/groovy/pull/3058#discussion_r4428616543
##########
src/main/java/org/codehaus/groovy/transform/sc/StaticCompilationVisitor.java:
##########
@@ -376,8 +378,12 @@ public void visitField(final FieldNode node) {
ClassNode declaringClass = node.getDeclaringClass();
if (declaringClass != null) {
if
(StaticTypeCheckingSupport.implementsInterfaceOrIsSubclassOf(declaringClass,
ClassHelper.LIST_TYPE)) {
- boolean spread =
declaringClass.getDeclaredField(node.getName()) != node;
- pexp.setSpreadSafe(spread);
+ boolean declaredField =
declaringClass.getDeclaredField(node.getName()) == node;
+ // GROOVY-12534: the virtual field for an extension
setter is not an element
+ // property. A declared field, or a real one-argument
setter, is unchanged.
+ if (declaredField ||
declaresUnarySetter(declaringClass, node.getName())) {
+ pexp.setSpreadSafe(!declaredField);
Review Comment:
why would we want to set it to false here?
--
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]