mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 17:20:54 +07:00
IDEA-323910 Implement parser for "JEP 443: Unnamed Patterns and Variables (Preview)" IDEA-323960 Support error highlighting for unnamed variables (JEP 443) GitOrigin-RevId: 1b9ee424063dfd4d32c2215fc8b0a9838dbdcd95
17 lines
1.1 KiB
Java
17 lines
1.1 KiB
Java
public class UnnamedPatterns {
|
|
record R(int a, int b) {}
|
|
|
|
void test(Object obj) {
|
|
if (obj instanceof <error descr="Since Java 9, '_' is a keyword, and may not be used as an identifier">_</error>) {}
|
|
|
|
if (obj instanceof R(<error descr="Unnamed patterns and variables are not supported at language level '20'">_</error>, <error descr="Unnamed patterns and variables are not supported at language level '20'">_</error>)) {}
|
|
if (obj instanceof R(int a, <error descr="Unnamed patterns and variables are not supported at language level '20'">_</error>)) {
|
|
System.out.println(a);
|
|
}
|
|
if (obj instanceof R(<error descr="Unnamed patterns and variables are not supported at language level '20'">_</error>, int b)) {
|
|
System.out.println(b);
|
|
}
|
|
if (obj instanceof R(<error descr="Unnamed patterns and variables are not supported at language level '20'">_</error>, <error descr="Unnamed patterns and variables are not supported at language level '20'">_</error>, <error descr="Unnamed patterns and variables are not supported at language level '20'">_</error>)) {
|
|
}
|
|
}
|
|
} |