Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-11003

Cannot find method with variable arguments when using fully qualified class names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.18, 4.0.12
    • Static Type Checker
    • None

    Description

      I have the following program

      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) { }
      }
      

      Actual behavior

      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
      

      Expected behavior

      Compile successfully

      Tested against master (commit: a4e0d6de9cc2d8ecb48b48df501e63ec1735d837)

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              theosot Thodoris Sotiropoulos
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: