You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Thodoris Sotiropoulos (Jira)" <ji...@apache.org> on 2023/04/07 13:08:00 UTC

[jira] [Created] (GROOVY-11003) Cannot find method with variable arguments when using fully qualified class names

Thodoris Sotiropoulos created GROOVY-11003:
----------------------------------------------

             Summary: Cannot find method with variable arguments when using fully qualified class names
                 Key: GROOVY-11003
                 URL: https://issues.apache.org/jira/browse/GROOVY-11003
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
            Reporter: Thodoris Sotiropoulos


I have the following program

{code}
class Main {
  static final void test(java.util.List<Integer> p) {
    m(1, p);
  }

  static <T> void m(Integer x, java.util.List<T>... items) { }
}
{code}

h3. Actual behavior

{code}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
test.groovy: 3: [Static type checking] - Cannot find matching method Main#m(int, java.util.List<java.lang.Integer>). Please check if the declared type is correct and if the method exists.
 @ line 3, column 5.
       m(1, p);
       ^

1 error
{code}

h3. Expected behavior

Compile successfully

Tested against master (commit: a4e0d6de9cc2d8ecb48b48df501e63ec1735d837)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)