mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 20:30:42 +07:00
IDEA-290391 - quickfix for qualified enum constants inside switch + static import fix is available for enhanced switch
GitOrigin-RevId: dca0a0918832a1814473886f45edc31e8fa3e6f7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1d0aeb25a2
commit
b014f71140
@@ -0,0 +1,15 @@
|
||||
// "Add on-demand static import for 'test.Test.Letter'" "true"
|
||||
package test;
|
||||
|
||||
import static test.Test.Letter.*;
|
||||
|
||||
class Test {
|
||||
void test(Letter obj) {
|
||||
switch (obj) {
|
||||
case LETTER_A, LETTER_B -> System.out.println(10);
|
||||
case Letter l -> System.out.println(20);
|
||||
}
|
||||
}
|
||||
|
||||
enum Letter {LETTER_A, LETTER_B, LETTER_C}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// "Add on-demand static import for 'test.Test.Letter'" "true"
|
||||
package test;
|
||||
|
||||
import static test.Test.Letter.*;
|
||||
|
||||
class Test {
|
||||
void test(Letter obj) {
|
||||
switch (obj) {
|
||||
case LETTER_A, LETTER_B:
|
||||
System.out.println(10);
|
||||
break;
|
||||
case Letter l:
|
||||
System.out.println(20);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
enum Letter {LETTER_A, LETTER_B, LETTER_C}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add on-demand static import for 'test.Test.Letter'" "true"
|
||||
package test;
|
||||
|
||||
class Test {
|
||||
void test(Letter obj) {
|
||||
switch (obj) {
|
||||
case <caret>Letter.LETTER_A, Letter.LETTER_B -> System.out.println(10);
|
||||
case Letter l -> System.out.println(20);
|
||||
}
|
||||
}
|
||||
|
||||
enum Letter {LETTER_A, LETTER_B, LETTER_C}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Add on-demand static import for 'test.Test.Letter'" "true"
|
||||
package test;
|
||||
|
||||
class Test {
|
||||
void test(Letter obj) {
|
||||
switch (obj) {
|
||||
case <caret>Letter.LETTER_A, Letter.LETTER_B:
|
||||
System.out.println(10);
|
||||
break;
|
||||
case Letter l:
|
||||
System.out.println(20);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
enum Letter {LETTER_A, LETTER_B, LETTER_C}
|
||||
}
|
||||
Reference in New Issue
Block a user