Support local classes

This commit is contained in:
Tagir Valeev
2018-10-01 16:31:37 +07:00
parent 90f61a9546
commit 763ad22de9
6 changed files with 69 additions and 16 deletions
@@ -0,0 +1,14 @@
// "Replace 'switch' with 'if'" "true"
class X {
void test(int i) {
if (i == 1) {
class Foo {
}
System.out.println(new Foo());
} else if (i == 2) {
class Foo {
}
System.out.println("2" + new Foo());
}
}
}
@@ -0,0 +1,12 @@
// "Replace 'switch' with 'if'" "true"
class X {
void test(int i) {
if (i == 1) {
class Foo {
}
System.out.println(new Foo());
} else if (i == 2) {
System.out.println("2");
}
}
}
@@ -0,0 +1,13 @@
// "Replace 'switch' with 'if'" "true"
class X {
void test(int i) {
swi<caret>tch(i) {
case 1:
class Foo{}
System.out.println(new Foo());
break;
case 2:
System.out.println("2"+new Foo());
}
}
}
@@ -0,0 +1,13 @@
// "Replace 'switch' with 'if'" "true"
class X {
void test(int i) {
swi<caret>tch(i) {
case 1:
class Foo{}
System.out.println(new Foo());
break;
case 2:
System.out.println("2");
}
}
}