--- a/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java Fri May 24 04:18:18 2019 -0700
+++ b/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java Tue Jul 02 09:14:51 2019 +0200
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8223305
+ * @bug 8223305 8226522
* @summary Verify correct warnings w.r.t. yield
* @compile/ref=WarnWrongYieldTest.out -source 13 -XDrawDiagnostics -XDshould-stop.at=ATTR WarnWrongYieldTest.java
*/
@@ -159,4 +159,12 @@
//OK - yield is a variable:
yield[0] = 5;
}
+
+ private void lambda() {
+ SAM s = (yield y) -> {};
+ }
+
+ interface SAM {
+ public void m(yield o);
+ }
}