aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 8003280 aoqi@0: * @summary Add lambda tests aoqi@0: * check that target type of a method ref is a SAM type aoqi@0: * @author Maurizio Cimadamore aoqi@0: * @compile/fail/ref=MethodReference04.out -XDrawDiagnostics MethodReference04.java aoqi@0: */ aoqi@0: aoqi@0: class MethodReference04 { aoqi@0: void m(Integer i) {} aoqi@0: aoqi@0: Object o = this::m; //fail - not a valid target type aoqi@0: }