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

Single super constructor argument is casted to array if super constructor has vararg parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 2.0.0, 1.8.7
    • Compiler
    • None

    Description

      class Foo {
        def Foo(String... s) { }
      }
      class ImplOneParameter extends Foo {
        def ImplOneParameter(String s) {
          super(s)
        }
      }
      class ImplArray extends Foo {
        def ImplArray(String[] s) {
          super(s)
        }
      }
      
      
      new ImplArray("String")
      new ImplOneParameter("String") //fails with CCE
      

      The same dispatch as for usual method calls should apply.

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              gromopetr Peter Gromov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: