aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 8003280 aoqi@0: * @summary Add lambda tests aoqi@0: * check that the compiler emits meaningful diagnostics when the lambda body contains bad statements aoqi@0: * @author Maurizio Cimadamore aoqi@0: * @compile/fail/ref=BadStatementInLambda.out -XDrawDiagnostics BadStatementInLambda.java aoqi@0: */ aoqi@0: aoqi@0: class BadStatementInLambda { aoqi@0: aoqi@0: interface SAM{ aoqi@0: Object m(); aoqi@0: } aoqi@0: aoqi@0: SAM t1 = ()-> { null; }; aoqi@0: SAM t2 = ()-> { 1; }; aoqi@0: SAM t3 = ()-> { 1 + 5; }; aoqi@0: }