mcimadamore@1415: /* mcimadamore@1415: * @test /nodynamiccopyright/ mcimadamore@1415: * @bug 8003280 mcimadamore@1415: * @summary Add lambda tests mcimadamore@1415: * check case of ambiguous method call with lambda whose body cannot mcimadamore@1415: complete normally mcimadamore@1415: * @compile/fail/ref=TargetType23.out -XDrawDiagnostics TargetType23.java mcimadamore@1415: */ mcimadamore@1415: mcimadamore@1415: class TargetType23 { mcimadamore@1415: mcimadamore@1415: interface Sam0 { mcimadamore@1415: void m(); mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: interface Sam1 { mcimadamore@1415: int m(); mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: interface Sam2 { mcimadamore@1415: String m(); mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: interface Sam3 { mcimadamore@1415: A m(); mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: mcimadamore@1415: void call(Sam0 s) { } mcimadamore@1415: void call(Sam1 s) { } mcimadamore@1415: void call(Sam2 s) { } mcimadamore@1415: void call(Sam3 s) { } mcimadamore@1415: mcimadamore@1415: void test() { mcimadamore@1415: call(()-> { throw new RuntimeException(); }); //ambiguous - both call(Sam0), call(Sam2), call(Sam3) match mcimadamore@1415: } mcimadamore@1415: }