mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
8226510: No compilation error when switch expression has no result expressions
Ensure a compile-time error is produced when there are no result expressions in an switch expression. Reviewed-by: vromero
This commit is contained in:
parent
df6fbdb2af
commit
e81d3fa8c3
15 changed files with 90 additions and 18 deletions
|
@ -30,7 +30,8 @@ class ContinueOutsideSwitchExpression {
|
|||
int t(int i) {
|
||||
OUT: while (true) {
|
||||
return switch (i) {
|
||||
default: continue OUT;
|
||||
case 0: continue OUT;
|
||||
default: yield 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue