2018-08-29 09:36:17 +02:00
|
|
|
/*
|
|
|
|
* @test /nodynamiccopyright/
|
|
|
|
* @bug 8206986
|
|
|
|
* @summary Verify that scopes in rule cases are isolated.
|
2018-12-13 19:06:11 +01:00
|
|
|
* @compile/fail/ref=SwitchStatementScopesIsolated.out -XDrawDiagnostics --enable-preview -source 13 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"; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|