mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 16:39:37 +07:00
IDEA didn't use to consider that there might be instanceof patterns in the guard expression, so it ignored this part during resolution. Now IDEA tries to resolve a reference against both the pattern variable and guarding expression. GitOrigin-RevId: 249ce6ec8ec6db84f9a5fc4622b4433550b38bf4
16 lines
286 B
Java
16 lines
286 B
Java
|
|
class Main {
|
|
void f(Object o) {
|
|
if (o instanceof (CharSequence cs && cs instanceof String s)) {
|
|
System.out.println(s);
|
|
}
|
|
}
|
|
|
|
void g(Object o) {
|
|
switch (o) {
|
|
case Integer i && o instanceof String s:
|
|
System.out.println(s);
|
|
default:
|
|
};
|
|
}
|
|
} |