mcimadamore@1415: /* mcimadamore@1415: * @test /nodynamiccopyright/ mcimadamore@1415: * @bug 8003280 mcimadamore@1415: * @summary Add lambda tests mcimadamore@1415: * This test is for identifying a non-SAM type: Having more than one methods due to inheritance, and none of them has a subsignature of all other methods mcimadamore@1415: * @compile/fail/ref=NonSAM2.out -XDrawDiagnostics NonSAM2.java Helper.java mcimadamore@1415: */ mcimadamore@1415: mcimadamore@1415: import java.util.List; mcimadamore@1415: mcimadamore@1415: interface Foo1 { int getAge(String s);} mcimadamore@1415: interface Bar1 { Integer getAge(String s);} mcimadamore@1415: interface Foo1Bar1 extends Foo1, Bar1 {} //types Bar1 and Foo1 are incompatible; both define getAge(String), but with unrelated return types mcimadamore@1415: mcimadamore@1415: interface AC extends A, C {} //name clash: getOldest(List) in C and getOldest(List) in A have the same erasure, yet neither overrides the other mcimadamore@1415: interface ABC extends A, B, C {} //name clash: getOldest(List) in C and getOldest(List) in A have the same erasure, yet neither overrides the other mcimadamore@1415: interface AD extends A, D {} //name clash: getOldest(List) in D and getOldest(List) in A have the same erasure, yet neither overrides the other mcimadamore@1415: mcimadamore@1415: interface Foo2 { void m(T arg);} mcimadamore@1415: interface Bar2 { void m(S arg);} mcimadamore@1415: interface Foo2Bar2 extends Foo2, Bar2 {} //name clash: m(S) in Bar and m(T) in Foo have the same erasure, yet neither overrides the other