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
98 lines
2.3 KiB
Java
98 lines
2.3 KiB
Java
|
|
class Main {
|
|
void ff(Object o) {
|
|
switch (o) {
|
|
case String s:
|
|
case null:
|
|
case <error descr="Illegal fall-through to a pattern">Integer i</error>:
|
|
System.out.println(<error descr="Cannot resolve symbol 'i'">i</error> + 1);
|
|
break;
|
|
case Long l:
|
|
System.out.println(l);
|
|
case <error descr="Illegal fall-through to a pattern">Character c</error>:
|
|
System.out.println(<error descr="Cannot resolve symbol 'c'">c</error>);
|
|
default:
|
|
throw new IllegalStateException("Unexpected value: " + o);
|
|
}
|
|
}
|
|
void f(Object o) {
|
|
switch (o) {
|
|
case null: {
|
|
}
|
|
case <error descr="Illegal fall-through to a pattern">Integer i</error>:
|
|
System.out.println(i + 1);
|
|
default:
|
|
throw new IllegalStateException("Unexpected value: " + o);
|
|
}
|
|
}
|
|
|
|
void g(Object o) {
|
|
switch (o) {
|
|
case null:
|
|
case Integer i:
|
|
System.out.println(i + 1);
|
|
default:
|
|
throw new IllegalStateException("Unexpected value: " + o);
|
|
}
|
|
}
|
|
|
|
void h(Object o) {
|
|
switch (o) {
|
|
case null: {
|
|
System.out.println();
|
|
break;
|
|
}
|
|
case Integer i:
|
|
System.out.println(i + 1);
|
|
default:
|
|
throw new IllegalStateException("Unexpected value: " + o);
|
|
}
|
|
}
|
|
|
|
void i(Object o) {
|
|
switch (o) {
|
|
case null:
|
|
System.out.println();
|
|
break;
|
|
case Integer i:
|
|
System.out.println(i + 1);
|
|
default:
|
|
throw new IllegalStateException("Unexpected value: " + o);
|
|
}
|
|
}
|
|
|
|
void k(Object o) {
|
|
switch (o) {
|
|
case String s:
|
|
System.out.println();
|
|
break;
|
|
case Integer i:
|
|
System.out.println(i + 1);
|
|
default:
|
|
throw new IllegalStateException("Unexpected value: " + o);
|
|
}
|
|
}
|
|
|
|
void l(Object o) {
|
|
switch (o) {
|
|
case String s: {
|
|
System.out.println();
|
|
break;
|
|
}
|
|
case Integer i:
|
|
System.out.println(i + 1);
|
|
default:
|
|
throw new IllegalStateException("Unexpected value: " + o);
|
|
}
|
|
}
|
|
|
|
void m(Object o) {
|
|
switch (o) {
|
|
case String s:
|
|
case <error descr="Illegal fall-through to a pattern">Integer i</error>:
|
|
System.out.println(<error descr="Cannot resolve symbol 'i'">i</error> + 1);
|
|
default:
|
|
throw new IllegalStateException("Unexpected value: " + o);
|
|
}
|
|
}
|
|
} |