test/langtools/tools/javac/switchexpr/WrongYieldTest.java
changeset 55561 4c0a7916d3cd
parent 55306 ea43db53de91
child 58679 9c3209ff7550
child 59021 cfc7bb9a5a92
--- a/test/langtools/tools/javac/switchexpr/WrongYieldTest.java	Fri May 24 04:18:18 2019 -0700
+++ b/test/langtools/tools/javac/switchexpr/WrongYieldTest.java	Tue Jul 02 09:14:51 2019 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8223305
+ * @bug 8223305 8226522
  * @summary Ensure proper errors are returned for yields.
  * @compile/fail/ref=WrongYieldTest.out --enable-preview -source ${jdk.version} -XDrawDiagnostics -XDshould-stop.at=ATTR WrongYieldTest.java
  */
@@ -222,4 +222,12 @@
         //OK - yield is a variable:
         yield[0] = 5;
     }
+
+    private void lambda() {
+        SAM s = (yield y) -> {};
+    }
+
+    interface SAM {
+        public void m(Object o);
+    }
 }