ambiguity of implicit constructor call (IDEA-160248)

This commit is contained in:
Anna Kozlova
2016-08-25 17:36:03 +03:00
parent 62760b94f7
commit 5774dbf0cd
3 changed files with 86 additions and 0 deletions
@@ -0,0 +1,28 @@
class A {
A(String... i) {}
A(Integer... i) {}
}
class B extends A {
<error descr="Ambiguous method call: both 'A.A(String...)' and 'A.A(Integer...)' match">public B()</error> {}
}
<error descr="Ambiguous method call: both 'A.A(String...)' and 'A.A(Integer...)' match">class C extends A</error> {}
class A1 {
A1(String... i){}
A1(Object... i){}
}
class B1 extends A1 {
public B1() {}
}
class C1 extends A1 {}
class A2 {
A2(int... i){}
A2(Object... i){}
}
class B2 extends A2 {
<error descr="Ambiguous method call: both 'A2.A2(int...)' and 'A2.A2(Object...)' match">public B2()</error> {
}
}
<error descr="Ambiguous method call: both 'A2.A2(int...)' and 'A2.A2(Object...)' match">class C2 extends A2</error> {}