2018-08-29 09:36:17 +02:00
|
|
|
/*
|
|
|
|
* @test /nodynamiccopyright/
|
|
|
|
* @bug 8206986
|
|
|
|
* @summary Verify that scopes in rule cases are isolated.
|
2019-02-21 10:29:16 -08:00
|
|
|
* @compile/fail/ref=SwitchStatementScopesIsolated.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchStatementScopesIsolated.java
|
2018-08-29 09:36:17 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class SwitchStatementScopesIsolated {
|
|
|
|
|
|
|
|
private void scopesIsolated(int i) {
|
|
|
|
switch (i) {
|
|
|
|
case 0 -> { String res = "NULL-A"; }
|
|
|
|
case 1 -> { res = "NULL-A"; }
|
|
|
|
default -> { res = "NULL-A"; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|