test/tools/javac/lambda/BadRecovery.java

changeset 0
959103a6100f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/tools/javac/lambda/BadRecovery.java	Wed Apr 27 01:34:52 2016 +0800
     1.3 @@ -0,0 +1,19 @@
     1.4 +/*
     1.5 + * @test /nodynamiccopyright/
     1.6 + * @bug 8003280
     1.7 + * @summary Add lambda tests
     1.8 + *  check that recovery of speculative types is not attempted if receiver is erroneous
     1.9 + * @compile/fail/ref=BadRecovery.out -XDrawDiagnostics BadRecovery.java
    1.10 + */
    1.11 +class BadRecovery {
    1.12 +
    1.13 +    interface SAM1 {
    1.14 +        void m(Object o);
    1.15 +    }
    1.16 +
    1.17 +    void m(SAM1 m) { };
    1.18 +
    1.19 +    void test() {
    1.20 +        m((receiver, t) -> { receiver.someMemberOfReceiver(()->{ Object x = f; }); });
    1.21 +    }
    1.22 +}

mercurial