test/tools/javac/lambda/funcInterfaces/NonSAM2.java

changeset 1811
349160289ba2
parent 1415
01c9d4161882
child 2525
2eb010b6cb22
equal deleted inserted replaced
1810:7889d1fe2597 1811:349160289ba2
11 interface Foo1 { int getAge(String s);} 11 interface Foo1 { int getAge(String s);}
12 interface Bar1 { Integer getAge(String s);} 12 interface Bar1 { Integer getAge(String s);}
13 interface Foo1Bar1 extends Foo1, Bar1 {} //types Bar1 and Foo1 are incompatible; both define getAge(String), but with unrelated return types 13 interface Foo1Bar1 extends Foo1, Bar1 {} //types Bar1 and Foo1 are incompatible; both define getAge(String), but with unrelated return types
14 14
15 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 15 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
16 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 16 interface ABC extends A, B, C {} //ok - raw override
17 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 17 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
18 18
19 interface Foo2<T> { void m(T arg);} 19 interface Foo2<T> { void m(T arg);}
20 interface Bar2<S> { void m(S arg);} 20 interface Bar2<S> { void m(S arg);}
21 interface Foo2Bar2<T1, T2> extends Foo2<T1>, Bar2<T2> {} //name clash: m(S) in Bar and m(T) in Foo have the same erasure, yet neither overrides the other 21 interface Foo2Bar2<T1, T2> extends Foo2<T1>, Bar2<T2> {} //name clash: m(S) in Bar and m(T) in Foo have the same erasure, yet neither overrides the other

mercurial