Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/LocalClassParameters.java
Mikhail Pyltsin b4dd504e01 [java-highlighting] IDEA-341846 Code with instanceof for a local class inside a generic function is marked as red
- skip methods to capture parameters

GitOrigin-RevId: df0c152d33bb9f880dad2428b7635d06209b3e0c
2024-02-05 19:44:16 +00:00

23 lines
506 B
Java

class C<A> {
static <T> Object foo(Object x) {
class Local {
}
return (x instanceof Local) ? x : new Local();
}
static <T> Object foo2(Object x) {
class Local<T> {
}
return (x instanceof Local) ? x : new Local();
}
Object foo3(Object x) {
class Local {
}
return (x instanceof <error descr="Illegal generic type for instanceof">Local</error>) ? x : new Local();
}
public static void main(String[] args) {
System.out.println(C.<Integer>foo(""));
}
}