mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-25 10:51:06 +07:00
Resolve as many references as possible in order to keep the GoToSymbol action available but move invalid references in pattern matching for switch to the highlighter pass as the code review suggests GitOrigin-RevId: 2339b7c9cd02b0d1e3c793c30a8a3338c28c9b73
35 lines
865 B
Java
35 lines
865 B
Java
|
|
public class Main {
|
|
int expr(Object o) {
|
|
return switch(o) {
|
|
case String s -> 1;
|
|
case String s1 -> <error descr="Cannot resolve symbol 's'">s</error>.length();
|
|
case Integer i -> i;
|
|
default -> 0;
|
|
};
|
|
}
|
|
|
|
static void statement(Object o) {
|
|
switch(o) {
|
|
case String s:
|
|
case String s1:
|
|
System.out.println(<error descr="Cannot resolve symbol 's'">s</error>.length());
|
|
case Integer i:
|
|
System.out.println(i);
|
|
default:
|
|
System.out.println(1);
|
|
};
|
|
}
|
|
|
|
static void nested(Object o, String title) {
|
|
String header = "Hello";
|
|
switch (o) {
|
|
case String s:
|
|
switch (o) {
|
|
case String <error descr="Variable 's' is already defined in the scope">s</error>:
|
|
case String s1:
|
|
System.out.println(title + header + ":" + s);
|
|
}
|
|
}
|
|
}
|
|
} |