type distinct prover asymmetry fixed (IDEA-118533)

This commit is contained in:
Anna Kozlova
2014-05-31 20:36:02 +04:00
parent 6b5c924a4e
commit fdcb20b740
3 changed files with 18 additions and 3 deletions
@@ -90,10 +90,13 @@ public class TypesDistinctProver {
if (type2 instanceof PsiArrayType) {
return proveArrayTypeDistinct(((PsiWildcardType)type1).getManager().getProject(), (PsiArrayType)type2, type1);
}
}
if (type1 instanceof PsiCapturedWildcardType) return provablyDistinct(((PsiCapturedWildcardType)type1).getWildcard(), type2, level);
} else {
if (type2 instanceof PsiWildcardType || type2 instanceof PsiCapturedWildcardType) return provablyDistinct(type2, type1, level);
if (type2 instanceof PsiWildcardType) return provablyDistinct(type2, type1, level);
if (type1 instanceof PsiCapturedWildcardType) return provablyDistinct(((PsiCapturedWildcardType)type1).getWildcard(), type2, level);
if (type2 instanceof PsiCapturedWildcardType) return provablyDistinct(type2, type1, level);
}
final PsiClassType.ClassResolveResult classResolveResult1 = PsiUtil.resolveGenericsClassInType(type1);
@@ -0,0 +1,11 @@
abstract class Test {
interface InputFormat<K, V> {
}
@SuppressWarnings("unchecked")
private static Class<? extends InputFormat<?, ?>> getInputFormatClass(final Class<? extends InputFormat> aClass)
throws ClassNotFoundException {
return (Class<? extends InputFormat<?, ?>>) aClass;
}
}
@@ -356,6 +356,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA118536() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testIDEA125744() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testIDEA125423() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testIDEA118533() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testJavaUtilCollections_NoVerify() throws Exception {
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));