Details
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
- is duplicated by
-
GROOVY-4015
GStrings are not coerced to Strings in super constructor call
-
-
GROOVY-4122
super-constructor-call does not work for var args constructors
-
The ClassCastException part of this issue has been fixed under
GROOVY-4015.What is remaining now is that super("String") call to Foo(String...s) is becoming equivalent to "String" as String[] and reaching the vararg String[] of Foo#<init>() as [S, t, r, i, n, g].