class YieldStatements { static final int ref = -1; void m(int i) { default: yield 0; l1: yield l1; switch (i) { default: yield 0; } out: System.out.println(switch (i) { case 1 -> { while (true) yield ref; } case 2 -> { while (true) break wtf; } case 3 -> { yield ref; } case 4 -> { yield (ref); } case 5 -> { break wtf; } case 6 -> { int a = 0; a: switch (0) { default: yield a; } } case 7 -> { Runnable r = () -> { yield 0; }; r.run(); yield 0; } case 8 -> { switch (i) { default -> { yield 0; } } } case 9 -> { yield; } case 10 -> { int yield = i; yield yield; } case 11 -> { yield m(0); } case 12 -> { switch (i) { default: break out;; } } default -> throw new RuntimeException(); }); out: while (true) { System.out.println(switch (i) { case 0: break; default: break out; }); } } class yield { void test(yield yield) { } } }