langtools/test/tools/javac/lambda/BadRecovery.java
author duke
Wed, 05 Jul 2017 23:01:50 +0200
changeset 44228 e46434c65a2b
parent 14547 86d8d242b0c4
permissions -rw-r--r--
Merge
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
}