mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
generics: choose least bound symmetric (IDEA-57500)
This commit is contained in:
@@ -150,7 +150,7 @@ public class GenericsUtil {
|
||||
if (type2 instanceof PsiWildcardType) {
|
||||
PsiWildcardType wild2 = (PsiWildcardType)type2;
|
||||
final PsiType bound2 = wild2.getBound();
|
||||
if (bound2 == null) return wild1;
|
||||
if (bound2 == null) return type2;
|
||||
if (wild1.isExtends() == wild2.isExtends()) {
|
||||
return wild1.isExtends() ?
|
||||
PsiWildcardType.createExtends(manager, getLeastUpperBound(bound1, bound2, compared, manager)) :
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package pck;
|
||||
|
||||
interface I<T> {}
|
||||
interface A extends I<I<? extends String>>{}
|
||||
interface B extends I<I<?>>{}
|
||||
|
||||
abstract class X {
|
||||
abstract <T> T foo(T x, T y);
|
||||
|
||||
void bar(A x, B y){
|
||||
foo(x, y);
|
||||
foo(y, y);
|
||||
}
|
||||
}
|
||||
@@ -192,6 +192,10 @@ public class AdvHighlightingJdk7Test extends DaemonAnalyzerTestCase {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
public void testAmbiguousIDEA57500() throws Exception {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
public void testAmbiguousMethodsFromSameClassAccess() throws Exception {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user