You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2021/04/25 22:50:52 UTC

[GitHub] [groovy] eric-milles commented on a change in pull request #1571: GROOVY-10056: Inferred parameter type of lambda expression for multi-…

eric-milles commented on a change in pull request #1571:
URL: https://github.com/apache/groovy/pull/1571#discussion_r619891683



##########
File path: src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
##########
@@ -5305,10 +5305,7 @@ protected ClassNode inferReturnTypeGenerics(final ClassNode receiver, final Meth
                                             applyGenericsContextToParameterClass(resolvedPlaceholders, paramType));
                         }
                     }
-                    if (isVargs && lastArg && argumentType.isArray()) {
-                        argumentType = argumentType.getComponentType();
-                    }
-                    if (isVargs && lastArg && paramType.isArray()) {
+                    if (isVargs && lastArg && paramType.isArray() && !argumentType.isArray()) {
                         paramType = paramType.getComponentType();
                     }

Review comment:
       What about tying the checks together?  I have tried this for the test case, but have run out of time today to run the full test suite.
   ```java
                       if (isVargs && lastArg && argumentType.isArray() && paramType.isArray()) {
                           argumentType = argumentType.getComponentType();
                           paramType = paramType.getComponentType();
                       }
   ```




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org