langtools/test/tools/javac/lambda/speculative/8154180/T8154180b.java
changeset 38512 c71e1cdd6674
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/speculative/8154180/T8154180b.java	Mon May 16 14:51:17 2016 +0100
@@ -0,0 +1,27 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8154180
+ * @summary Regression: stuck expressions do not behave correctly
+ * @compile/fail/ref=T8154180b.out -XDrawDiagnostics T8154180b.java
+ */
+class T8154180b {
+    interface Foo1 {
+       Object m(String s);
+    }
+
+    interface Foo2 {
+       String m(String s);
+    }
+
+
+    void m(Foo1 f1) { }
+    void m(Foo2 f2) { }
+
+    void test() {
+        m(x->"");
+        m((x->""));
+        m(true ? x -> "" : x -> "");
+        m((true ? x -> "" : x -> ""));
+        m((true ? (x -> "") : (x -> "")));
+    }
+}