side effects in for stmt declaration (IDEA-172700)

transformation should be added before for stmt
This commit is contained in:
Anna Kozlova
2017-06-28 16:10:43 +02:00
parent 352770463f
commit eb5c7ecb20
4 changed files with 38 additions and 2 deletions
@@ -0,0 +1,17 @@
// "Remove redundant initializer" "true"
class A {
void testFor() {
if (true) {
read();
for(int i;; i++) {
i = 10;
System.out.println("Hello!");
}
}
}
private static int read() {
System.out.println();
return 0;
}}
@@ -0,0 +1,15 @@
// "Remove redundant initializer" "true"
class A {
void testFor() {
if (true)
for(int i = re<caret>ad();;i++) {
i = 10;
System.out.println("Hello!");
}
}
private static int read() {
System.out.println();
return 0;
}}