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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: