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

Groovy 3.0.5 varargs [Static type checking] - Cannot find matching method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.5
    • 4.0.0-alpha-1, 2.5.14, 3.0.6
    • Compiler
    • None
    • Java version AdoptOpenJDK (build 25.262-b10, mixed mode)
      Gradle version 6.6.1
      Groovy version 3.0.5

    Description

      Compile error: [Static type checking] - Cannot find matching method foo.Foo#vfunc(java.lang.String, java.lang.Integer).

      If i is declared as int, then it compiles okay.
       

      package foo
      import groovy.transform.CompileStatic
      @CompileStatic
      class Foo {
          private void vfunc(String s, int... ints) {}
          void caller() {
              Integer i = 1
              vfunc('foo', i)
          }
      }
      

      Attachments

        1. g3varargs.tar.gz
          56 kB
          Chiang Seng Chang

        Activity

          People

            paulk Paul King
            chacs Chiang Seng Chang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: