unreachable code: qualified fields and array access in assignments (IDEA-144428)

This commit is contained in:
Anna Kozlova
2015-08-28 18:33:15 +03:00
parent e68462d50a
commit 3d96977c2c
5 changed files with 63 additions and 20 deletions
@@ -0,0 +1,31 @@
class Test {
String[] days = {"",""};
public static void foo1() {
for (; ; ) {
break;
<error descr="Unreachable statement">new Test().days = null;</error>
}
}
void bar1() {
for (; ; ) {
break;
<error descr="Unreachable statement">days = null;</error>
}
}
static void foo2() {
for (; ; ) {
break;
<error descr="Unreachable statement">new Test().days[0] = null;</error>
}
}
void bar2() {
for (;;) {
break;
<error descr="Unreachable statement">days[0] = null;</error>
}
}
}