aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 8003280 aoqi@0: * @summary Add lambda tests aoqi@0: * crash when incompatible method reference is found in conditional expression aoqi@0: * @compile/fail/ref=TargetType33.out -XDrawDiagnostics TargetType33.java aoqi@0: */ aoqi@0: aoqi@0: class TargetType33 { aoqi@0: aoqi@0: interface A { aoqi@0: X m(); aoqi@0: } aoqi@0: aoqi@0: void m(A a) { } aoqi@0: void m2(A a) { } aoqi@0: aoqi@0: int intRes(Object o) { return 42; } aoqi@0: aoqi@0: void testMethodRef(boolean flag) { aoqi@0: A c = flag ? this::intRes : this::intRes; aoqi@0: m(flag ? this::intRes : this::intRes); aoqi@0: m2(flag ? this::intRes : this::intRes); aoqi@0: } aoqi@0: }