1 /* 2 * @test /nodynamiccopyright/ 3 * @bug 8206986 4 * @summary Verify that scopes in rule cases are isolated. 5 * @compile/fail/ref=SwitchStatementScopesIsolated.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchStatementScopesIsolated.java 6 */ 7 8 public class SwitchStatementScopesIsolated { 9 10 private void scopesIsolated(int i) { 11 switch (i) { 12 case 0 -> { String res = "NULL-A"; } 13 case 1 -> { res = "NULL-A"; } 14 default -> { res = "NULL-A"; } 15 } 16 } 17 18 }