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
This commit is contained in:
Anna Kozlova
2021-02-10 09:44:05 +01:00
committed by intellij-monorepo-bot
parent da1828b44b
commit f355f4d8cd
3 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
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;
}
});
}
}