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
-
Activity
Roshan Dawrani
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Link |
This issue is duplicated by |
Roshan Dawrani
made changes -
| Link |
This issue is duplicated by |
blackdrag blackdrag
made changes -
| 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. |
{code:Java}
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 {code} The same dispatch as for usual method calls should apply. |
blackdrag blackdrag
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Assignee | blackdrag blackdrag [ blackdrag ] | |
| Fix Version/s | 1.8.7 [ 18317 ] | |
| Fix Version/s | 2.0.0 [ 18601 ] | |
| Resolution | Fixed [ 1 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
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].