blackdrag commented on code in PR #3079:
URL: https://github.com/apache/groovy/pull/3079#discussion_r4433926846
##########
src/main/java/org/codehaus/groovy/classgen/asm/ClosureWriter.java:
##########
@@ -1475,7 +1475,9 @@ protected ClassNode createClosureClass(final
ClosureExpression expression, final
// GROOVY-9971: closure return type is mapped to Groovy cast by
classgen
ClassNode returnType =
expression.getNodeMetaData(INFERRED_RETURN_TYPE);
if (returnType == null) returnType = ClassHelper.OBJECT_TYPE; // not
STC or unknown path
- else if (returnType.isPrimaryClassNode()) returnType =
returnType.getPlainNodeReference();
+ // the class node itself carries the declared type parameters; a
parameterized reference to a class of the
+ // compilation unit keeps its type arguments, as a reference to a
class read from bytecode does
+ else if (returnType.isPrimaryClassNode() &&
!returnType.isRedirectNode()) returnType = returnType.getPlainNodeReference();
Review Comment:
Am I seeing wrong or is this here a code block equal to what is in
inferredClosureReturnType? If yes then I suggest you remove the code here and
actually call that method.
--
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]