IDEA-223192 Non-initialized variable error is not displayed in nested switch statement

GitOrigin-RevId: 850afa74fb22dd858bdc8ff7903946678e53d82c
This commit is contained in:
Tagir Valeev
2019-09-24 08:02:50 +00:00
committed by intellij-monorepo-bot
parent 46cf985f64
commit acb3387b1c
2 changed files with 19 additions and 2 deletions
@@ -261,4 +261,21 @@ class ParenthesizedThis {
(this).x = 5; // javac disallows this -- probably a bug in javac
<error descr="Variable 'x' might already have been assigned to">this.x</error> = 6;
}
}
}
class NestedSwitch {
public static void main(String[] args) {
for(int i = 0; i < 8; i++) {
switch (i) {
case 0:
break;
default:
switch (i+1) {
default:
final int var;
<error descr="Variable 'var' might not have been initialized">var</error>++;
}
}
}
}
}