mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-17 21:43:33 +07:00
Patterns resolve: stop at switch label; filter by name before doing control flow analysis when possible (IDEA-229846)
Review ID: IDEA-CR-56992 GitOrigin-RevId: 4264da45582f5d38e3b5630184d8ab762f30575b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1a2437cb71
commit
43e64e1c56
+28
@@ -0,0 +1,28 @@
|
||||
class X {
|
||||
void test(Object obj, int x) {
|
||||
switch (x) {
|
||||
case 1:
|
||||
if (!(obj instanceof String s)) return;
|
||||
System.out.println(s.trim());
|
||||
case 2:
|
||||
if (!(obj instanceof Number s)) return;
|
||||
System.out.println(s.longValue());
|
||||
case 3:
|
||||
System.out.println(<error descr="Cannot resolve symbol 's'">s</error>);
|
||||
}
|
||||
}
|
||||
|
||||
void testWhile(Object obj, int x) {
|
||||
switch (x) {
|
||||
case 1:
|
||||
while(!(obj instanceof String s)) {
|
||||
obj = getNextObject();
|
||||
}
|
||||
System.out.println(s.trim());
|
||||
case 2:
|
||||
System.out.println(<error descr="Cannot resolve symbol 's'">s</error>.trim());
|
||||
}
|
||||
}
|
||||
|
||||
native Object getNextObject();
|
||||
}
|
||||
Reference in New Issue
Block a user