[java-highlighting] checkVariableExpected; yield checks migrated

Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: e4261df8c429a46d6aa238b7dcb4a97fdc45f9eb
This commit is contained in:
Tagir Valeev
2025-01-29 11:16:24 +01:00
committed by intellij-monorepo-bot
parent d50a093e84
commit 2b4707f2ef
9 changed files with 74 additions and 72 deletions

View File

@@ -2,12 +2,12 @@ class YieldStatements {
static final int ref = -1;
void m(int i) {
<error descr="Case statement outside switch">default:</error> <error descr="Yield outside of switch expression">yield 0;</error>
<error descr="Case statement outside switch">default:</error> <error descr="'yield' outside of a switch expression">yield 0;</error>
l1: yield <error descr="Cannot resolve symbol 'l1'">l1</error>;
switch (i) {
default: <error descr="Yield outside of switch expression">yield 0;</error>
default: <error descr="'yield' outside of a switch expression">yield 0;</error>
}
out: System.out.println(switch (i) {
@@ -21,7 +21,7 @@ class YieldStatements {
a: switch (0) { default: yield a; }
}
case 7 -> {
Runnable r = () -> { <error descr="Yield outside of switch expression">yield 0;</error> };
Runnable r = () -> { <error descr="'yield' outside of a switch expression">yield 0;</error> };
r.run();
yield 0;
}