You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/04/26 00:16:42 UTC

[groovy] branch LABS-GROOVY-10056-2 created (now a868208)

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a change to branch LABS-GROOVY-10056-2
in repository https://gitbox.apache.org/repos/asf/groovy.git.


      at a868208  GROOVY-10056: Inferred parameter type of lambda expression for multi-dimensions array is not correct

This branch includes the following new commits:

     new a868208  GROOVY-10056: Inferred parameter type of lambda expression for multi-dimensions array is not correct

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[groovy] 01/01: GROOVY-10056: Inferred parameter type of lambda expression for multi-dimensions array is not correct

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch LABS-GROOVY-10056-2
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit a86820843b6f3317ce600d4560691a103f2c6b5f
Author: Daniel Sun <su...@apache.org>
AuthorDate: Mon Apr 26 08:16:18 2021 +0800

    GROOVY-10056: Inferred parameter type of lambda expression for multi-dimensions array is not correct
    
    https://github.com/apache/groovy/pull/1571#discussion_r619891683
---
 .../org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
index cc95546..b064b6c 100644
--- a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -5305,7 +5305,8 @@ public class StaticTypeCheckingVisitor extends ClassCodeVisitorSupport {
                                             applyGenericsContextToParameterClass(resolvedPlaceholders, paramType));
                         }
                     }
-                    if (isVargs && lastArg && paramType.isArray() && !argumentType.isArray()) {
+                    if (isVargs && lastArg && argumentType.isArray() && paramType.isArray()) {
+                        argumentType = argumentType.getComponentType();
                         paramType = paramType.getComponentType();
                     }
                     argumentType = wrapTypeIfNecessary(argumentType);