Files
Tagir Valeev c449c341b7 [java-highlighting] test-data adjusted (mostly anchors) after recent updates
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 1e1b77009dc78de49c7cc5c44d4704937397bb23
2025-01-29 11:35:30 +00:00

35 lines
1.0 KiB
Java

import java.util.function.*;
public class UnnamedVariables {
void testParameter(int <error descr="Variable '_' is already defined in the scope">_</error>, String <error descr="Variable '_' is already defined in the scope">_</error>) {
System.out.println(_);
}
void testOneParam(String _) {
System.out.println(_);
}
int _ = 123;
String s = <error descr="Incompatible types. Found: 'int', required: 'java.lang.String'">_</error>;
void testLocal() {
int _ = 10;
int <error descr="Variable '_' is already defined in the scope">_</error> = 20;
for (int <error descr="Variable '_' is already defined in the scope">_</error> = 1;;) {}
}
void testCatch() {
try {
System.out.println();
}
catch (Exception _) {
System.out.println("ignore");
}
catch (Error _) {
int <error descr="Variable '_' is already defined in the scope">_</error> = 1;
for(int <error descr="Variable '_' is already defined in the scope">_</error>:new int[10]) {
System.out.println("oops");
}
}
}
}