mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-27 22:20:54 +07:00
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only) GitOrigin-RevId: 1e1b77009dc78de49c7cc5c44d4704937397bb23
35 lines
1.0 KiB
Java
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");
|
|
}
|
|
}
|
|
}
|
|
} |