8008627: Compiler mishandles three-way return-type-substitutability

Compiler should not enforce an order in how ambiguous methods should be resolved

Reviewed-by: jjg, vromero
This commit is contained in:
Maurizio Cimadamore 2013-06-06 15:33:40 +01:00
parent 4cb585609d
commit 07baf8072a
4 changed files with 54 additions and 21 deletions

View file

@ -13,7 +13,7 @@ interface Bar1 { Integer getAge(String s);}
interface Foo1Bar1 extends Foo1, Bar1 {} //types Bar1 and Foo1 are incompatible; both define getAge(String), but with unrelated return types
interface AC extends A, C {} //name clash: getOldest(List<?>) in C and getOldest(List<Number>) in A have the same erasure, yet neither overrides the other
interface ABC extends A, B, C {} //name clash: getOldest(List<?>) in C and getOldest(List<Number>) in A have the same erasure, yet neither overrides the other
interface ABC extends A, B, C {} //ok - raw override
interface AD extends A, D {} //name clash: getOldest(List<Integer>) in D and getOldest(List<Number>) in A have the same erasure, yet neither overrides the other
interface Foo2<T> { void m(T arg);}