Groovy
  1. Groovy
  2. GROOVY-4016

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.0
    • Fix Version/s: 2.0.0, 1.8.7
    • Component/s: Compiler
    • Labels:
      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.

        Issue Links

          Activity

            People

            • Assignee:
              Jochen Theodorou
              Reporter:
              Peter Gromov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development