langtools/test/tools/javac/lambda/BadStatementInLambda.java
author mcimadamore
Wed, 26 Oct 2016 15:41:25 +0100
changeset 41856 13a056e8f16e
parent 14547 86d8d242b0c4
permissions -rw-r--r--
8168774: Polymorhic signature method check crashes javac Summary: Check for polysig method assumes arity is greater than zero Reviewed-by: vromero

/*
 * @test /nodynamiccopyright/
 * @bug 8003280
 * @summary Add lambda tests
 *  check that the compiler emits meaningful diagnostics when the lambda body contains bad statements
 * @author  Maurizio Cimadamore
 * @compile/fail/ref=BadStatementInLambda.out -XDrawDiagnostics BadStatementInLambda.java
 */

class BadStatementInLambda {

    interface SAM{
        Object m();
    }

    SAM t1 = ()-> { null; };
    SAM t2 = ()-> { 1; };
    SAM t3 = ()-> { 1 + 5; };
}