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=SwitchExpressionScopesIsolated.out -XDrawDiagnostics --enable-preview -source 13 SwitchExpressionScopesIsolated.java
|
2018-08-29 09:36:17 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class SwitchExpressionScopesIsolated {
|
|
|
|
|
|
|
|
private String scopesIsolated(int i) {
|
|
|
|
return switch (i) {
|
|
|
|
case 0 -> { String res = ""; break res; }
|
|
|
|
case 1 -> { res = ""; break res; }
|
|
|
|
default -> { res = ""; break res; }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|