mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
distinguish wildcards with raw/generic bounds (IDEA-97276)
This commit is contained in:
@@ -126,6 +126,8 @@ public class TypesDistinctProver {
|
||||
final PsiClass boundClass1 = PsiUtil.resolveClassInType(extendsBound1);
|
||||
final PsiClass boundClass2 = PsiUtil.resolveClassInType(extendsBound2);
|
||||
if (boundClass1 != null && boundClass2 != null) {
|
||||
if (extendsBound1 instanceof PsiClassType && extendsBound2 instanceof PsiClassType &&
|
||||
(((PsiClassType)extendsBound1).isRaw() ^ ((PsiClassType)extendsBound2).isRaw())) return true;
|
||||
return proveExtendsBoundsDistinct(type1, type2, boundClass1, boundClass2);
|
||||
}
|
||||
return provablyDistinct(extendsBound1, extendsBound2, 1);
|
||||
|
||||
+13
@@ -2,3 +2,16 @@ interface Interf<X extends Interf> {}
|
||||
class SomeClass {
|
||||
static <I extends Interf<? super I>> Class<I> someMethod(I i) { return null; }
|
||||
}
|
||||
|
||||
interface OtherInterf<I1 extends Interf, I2 extends Interf> {}
|
||||
interface ImmutableSet<S> {}
|
||||
|
||||
class SomeOtherClass {
|
||||
static ImmutableSet<Class<? extends OtherInterf<?, ?>>> someOtherMethod() {
|
||||
return <error descr="Inconvertible types; cannot cast 'ImmutableSet<java.lang.Class<? extends OtherInterf>>' to 'ImmutableSet<java.lang.Class<? extends OtherInterf<?,?>>>'">(ImmutableSet<Class<? extends OtherInterf<?, ?>>>)aux(OtherInterf.class)</error>;
|
||||
}
|
||||
|
||||
static <T> ImmutableSet<Class<? extends T>> aux(Class<T> t) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user