mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
provably distinct: ? extends A should be provably distinct from Object until A is not an Object (IDEA-105695)
This commit is contained in:
@@ -58,6 +58,11 @@ public class TypesDistinctProver {
|
||||
proveArrayTypeDistinct(((PsiWildcardType)type1).getManager().getProject(), (PsiArrayType)extendsBound, type2)) return true;
|
||||
final PsiClass boundClass1 = PsiUtil.resolveClassInType(extendsBound);
|
||||
if (boundClass1 == null) return false;
|
||||
|
||||
if (CommonClassNames.JAVA_LANG_OBJECT.equals(psiClass2.getQualifiedName())) {
|
||||
return !CommonClassNames.JAVA_LANG_OBJECT.equals(boundClass1.getQualifiedName());
|
||||
}
|
||||
|
||||
return proveExtendsBoundsDistinct(type1, type2, boundClass1, psiClass2);
|
||||
}
|
||||
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import java.util.Map;
|
||||
|
||||
public class Test {
|
||||
void bar(Prop p) {
|
||||
Map<? extends String, ? extends String> map = <error descr="Inconvertible types; cannot cast 'Prop' to 'java.util.Map<? extends java.lang.String,? extends java.lang.String>'">(Map<? extends String, ? extends String>)p</error>;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class Hashtble<K,V> implements Map<K,V> {}
|
||||
abstract class Prop extends Hashtble<Object, Object>{}
|
||||
@@ -206,6 +206,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA86875() { doTest5(false); }
|
||||
public void testIDEA103760(){ doTest5(false); }
|
||||
public void testIDEA105846(){ doTest5(false); }
|
||||
public void testIDEA105695(){ doTest5(false); }
|
||||
|
||||
public void testWildcardsOnRawTypes() { doTest5(false); }
|
||||
public void testDisableWithinBoundsCheckForSuperWildcards() {
|
||||
|
||||
Reference in New Issue
Block a user