aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 8003280 aoqi@0: * @summary Add lambda tests aoqi@0: * check that cast conversion context does not affect compatibility of lambda aoqi@0: * @compile/fail/ref=TargetType38.out -XDrawDiagnostics TargetType38.java aoqi@0: */ aoqi@0: class TargetType38 { aoqi@0: aoqi@0: interface I { } aoqi@0: aoqi@0: interface SAM { aoqi@0: I m(); aoqi@0: } aoqi@0: aoqi@0: static Object m() { return null; } aoqi@0: aoqi@0: void test() { aoqi@0: Object o1 = (SAM)()->new Object(); aoqi@0: Object o2 = (SAM)TargetType38::m; aoqi@0: } aoqi@0: }