eric-milles commented on code in PR #2644:
URL: https://github.com/apache/groovy/pull/2644#discussion_r3494547955
##########
src/main/java/org/codehaus/groovy/transform/trait/TraitReceiverTransformer.java:
##########
@@ -414,6 +414,19 @@ private static MethodNode findConcreteMethod(final
ClassNode traitClass, final S
return methodNode;
}
}
+ // GROOVY-12117: when a co-compiled super trait has not been
transformed
+ // yet, its helper is still an empty GROOVY-7909 stub, so the
lowered
+ // static above is not found. The original static is still
declared on
+ // the trait node at this point, so resolve it there. This keeps
the
+ // rewrite independent of the order in which sibling traits are
+ // transformed (GEP-22 P1' dispatch consistency); the helper
resolves
+ // identically once every trait is lowered, so this only matters
for
+ // the not-yet-lowered super trait.
+ for (MethodNode methodNode :
superTrait.getDeclaredMethods(methodName)) {
+ if (methodNode.isPublic() && methodNode.isStatic()) {
+ return methodNode;
+ }
+ }
}
return null;
Review Comment:
It looks like the loop above this just needs the parameter check dropped,
instead of adding a full second loop.
--
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]