--- 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);
+ }
}