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

Joint compilation fails if Groovy method with array parameter is called in vararg style from Java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8-beta-1
    • 1.8.1, 1.7.11
    • Compiler
    • None

    Description

      Foo.groovy:

      class Foo {
        static foo(String[] args) {}
      }
      

      Bar.java:

      public class Bar {
        public static void main(String[] args) {
          Foo.foo("one", "two", "three");
        }
      }
      

      This compiles fine separately, but with joint compilation I get:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      Compile error during compilation with javac.
      Bar.java:3: foo(java.lang.String[]) in Foo cannot be applied to (java.lang.String,java.lang.String,java.lang.String)
      		Foo.foo("a", "b", "c");
      		       ^
      1 error
      

      I suppose stub generation is to blame.

      Attachments

        Activity

          People

            paulk Paul King
            pniederw Peter Niederwieser
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: