test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java
changeset 55561 4c0a7916d3cd
parent 55306 ea43db53de91
child 55573 e709712a8188
equal deleted inserted replaced
55560:cb0131439e9d 55561:4c0a7916d3cd
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8223305
    26  * @bug 8223305 8226522
    27  * @summary Verify correct warnings w.r.t. yield
    27  * @summary Verify correct warnings w.r.t. yield
    28  * @compile/ref=WarnWrongYieldTest.out -source 13 -XDrawDiagnostics -XDshould-stop.at=ATTR WarnWrongYieldTest.java
    28  * @compile/ref=WarnWrongYieldTest.out -source 13 -XDrawDiagnostics -XDshould-stop.at=ATTR WarnWrongYieldTest.java
    29  */
    29  */
    30 
    30 
    31 package t;
    31 package t;
   157         int[] yield = new int[1];
   157         int[] yield = new int[1];
   158 
   158 
   159         //OK - yield is a variable:
   159         //OK - yield is a variable:
   160         yield[0] = 5;
   160         yield[0] = 5;
   161     }
   161     }
       
   162 
       
   163     private void lambda() {
       
   164         SAM s = (yield y) -> {};
       
   165     }
       
   166 
       
   167     interface SAM {
       
   168         public void m(yield o);
       
   169     }
   162 }
   170 }