aoqi@0: /** aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 8004099 aoqi@0: * @summary Bad compiler diagnostic generated when poly expression is passed to non-existent method aoqi@0: * @compile/fail/ref=BadMethodCall2.out -XDrawDiagnostics BadMethodCall2.java aoqi@0: */ aoqi@0: class BadMethodCall2 { aoqi@0: void test(Object rec) { aoqi@0: rec.nonExistent(System.out::println); aoqi@0: rec.nonExistent(()->{}); aoqi@0: rec.nonExistent(true ? "1" : "2"); aoqi@0: } aoqi@0: }