langtools/test/tools/javac/lambda/BadRecovery.java
changeset 14547 86d8d242b0c4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/BadRecovery.java	Sat Nov 17 19:01:03 2012 +0000
@@ -0,0 +1,19 @@
+/*
+ * @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; }); });
+    }
+}