aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 8003280 aoqi@0: * @summary Add lambda tests aoqi@0: * This test is for identifying a non-SAM type: Having overloaded methods due to inheritance aoqi@0: * @compile/fail/ref=NonSAM3.out -XDrawDiagnostics NonSAM3.java Helper.java aoqi@0: */ aoqi@0: aoqi@0: import java.util.Collection; aoqi@0: import java.util.List; aoqi@0: aoqi@0: public class NonSAM3 { aoqi@0: void method() { aoqi@0: //all of the following will have compile error: "the target type of a lambda conversion has multiple non-overriding abstract methods" aoqi@0: FooBar fb = (Number n) -> 100; aoqi@0: FooBar fb2 = (Integer i) -> 100; aoqi@0: DE de = (List list) -> 100; aoqi@0: DE de2 = (List list) -> 100; aoqi@0: DE de3 = (List list) -> 100; aoqi@0: DE de4 = (Collection collection) -> 100; aoqi@0: DE de5 = (Collection collection) -> 100; aoqi@0: DE de6 = (Collection collection) -> 100; aoqi@0: } aoqi@0: }