langtools/test/tools/javac/lambda/BadRecovery.java
author mcimadamore
Sat, 17 Nov 2012 19:01:03 +0000
changeset 14547 86d8d242b0c4
permissions -rw-r--r--
8003280: Add lambda tests Summary: Turn on lambda expression, method reference and default method support Reviewed-by: jjg

/*
 * @test /nodynamiccopyright/
 * @bug 8003280
 * @summary Add lambda tests
 *  check that recovery of speculative types is not attempted if receiver is erroneous
 * @compile/fail/ref=BadRecovery.out -XDrawDiagnostics BadRecovery.java
 */
class BadRecovery {

    interface SAM1 {
        void m(Object o);
    }

    void m(SAM1 m) { };

    void test() {
        m((receiver, t) -> { receiver.someMemberOfReceiver(()->{ Object x = f; }); });
    }
}