Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/overloadResolution/OverloadedConstructors.java
Anna Kozlova f355f4d8cd java overload resolution: don't cache anonymous class hierarchies (IDEA-261747)
during overload resolution it may lead to caching of a wrong hierarchy, because type of anonymous class with diamonds depends on the surrounding method call
possible optimization: reject caching only for classes with diamonds or only during overload resolution

GitOrigin-RevId: ebdb068fb9052741b8bba2b50e5faefcc541438c
2021-02-10 09:36:31 +00:00

18 lines
294 B
Java

interface P1<T1> { boolean test(T1 t);}
interface P2<T2> { boolean test(T2 t);}
class C {
public C(P1<String> c) { }
public C(P2<String> p) { }
}
class C1 extends C {
public C1() {
super(new P2<>() {
public boolean test(String s) {
return false;
}
});
}
}