2018-08-29 07:36:17 +00:00
|
|
|
/*
|
|
|
|
* @test /nodynamiccopyright/
|
|
|
|
* @bug 8206986
|
|
|
|
* @summary Verify that scopes in rule cases are isolated.
|
2019-11-12 06:32:13 +00:00
|
|
|
* @compile/fail/ref=SwitchExpressionScopesIsolated.out -XDrawDiagnostics SwitchExpressionScopesIsolated.java
|
2018-08-29 07:36:17 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class SwitchExpressionScopesIsolated {
|
|
|
|
|
|
|
|
private String scopesIsolated(int i) {
|
|
|
|
return switch (i) {
|
2019-06-10 03:09:52 +00:00
|
|
|
case 0 -> { String res = ""; yield res; }
|
|
|
|
case 1 -> { res = ""; yield res; }
|
|
|
|
default -> { res = ""; yield res; }
|
2018-08-29 07:36:17 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|