langtools/test/tools/javac/lambda/BadRecovery.java
author vromero
Wed, 23 Jan 2013 20:57:40 +0000
changeset 15384 5a8d00abf076
parent 14547 86d8d242b0c4
permissions -rw-r--r--
8006694: temporarily workaround combo tests are causing time out in several platforms Reviewed-by: jjg Contributed-by: maurizio.cimadamore@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14547
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     1
/*
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     3
 * @bug 8003280
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     4
 * @summary Add lambda tests
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     5
 *  check that recovery of speculative types is not attempted if receiver is erroneous
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=BadRecovery.out -XDrawDiagnostics BadRecovery.java
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     7
 */
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     8
class BadRecovery {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     9
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    10
    interface SAM1 {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    11
        void m(Object o);
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    12
    }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    13
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    14
    void m(SAM1 m) { };
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    15
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    16
    void test() {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    17
        m((receiver, t) -> { receiver.someMemberOfReceiver(()->{ Object x = f; }); });
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    18
    }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    19
}