[java-highlighting] Fix testdata, tooltips

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

GitOrigin-RevId: ed0cf0daf5dbfb034882d49ad5e9c03f264b451e
This commit is contained in:
Tagir Valeev
2025-01-21 14:40:02 +01:00
committed by intellij-monorepo-bot
parent a0a7e71dff
commit 059a080ab3
43 changed files with 95 additions and 99 deletions

View File

@@ -17,13 +17,13 @@ class MyTest {
void m(int i) {
String s = foo(switch (i) {default -> "str";});
String s1 = <error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.String'">foo(switch (i) {case 1 -> new Object(); default -> "str";});</error>
String s1 = <error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.String'">foo</error>(switch (i) {case 1 -> new Object(); default -> "str";});
String s2 = foo(() -> switch (i) {
default -> "str";
});
String s3 = foo(() -> switch (i) {default -> bar();});
String s4 = foo(() -> switch (i) {default -> { yield bar();}});
String s5 = <error descr="Incompatible types. Found: 'java.lang.Integer', required: 'java.lang.String'">foo(() -> switch (i) {default -> { yield 1;}});</error>
String s5 = <error descr="Incompatible types. Found: 'java.lang.Integer', required: 'java.lang.String'">foo</error>(() -> switch (i) {default -> { yield 1;}});
String s6 = switch (i) {
case 1 -> <error descr="Bad type in switch expression: int cannot be converted to java.lang.String">2</error>;
default -> {