mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
provably distinct: continue to compare for nested levels (IDEA-126633)
This commit is contained in:
@@ -121,7 +121,7 @@ public class TypesDistinctProver {
|
||||
if (substitutedType1 instanceof PsiWildcardType && !((PsiWildcardType)substitutedType1).isBounded()) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
if (level < 2) return false;
|
||||
}
|
||||
|
||||
final PsiClass boundClass1 = classResolveResult1.getElement();
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import java.util.List;
|
||||
|
||||
class Test {
|
||||
<T> List<T> test(final List<Object> foo) {
|
||||
return (List<T>) foo;
|
||||
}
|
||||
|
||||
<T> List<List<T>> test1(final List<List<Object>> foo) {
|
||||
return <error descr="Inconvertible types; cannot cast 'java.util.List<java.util.List<java.lang.Object>>' to 'java.util.List<java.util.List<T>>'">(List<List<T>>) foo</error>;
|
||||
}
|
||||
|
||||
<T> List<List<List<T>>> test2(final List<List<List<Object>>> foo) {
|
||||
return <error descr="Inconvertible types; cannot cast 'java.util.List<java.util.List<java.util.List<java.lang.Object>>>' to 'java.util.List<java.util.List<java.util.List<T>>>'">(List<List<List<T>>>) foo</error>;
|
||||
}
|
||||
}
|
||||
@@ -368,6 +368,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA125816() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
public void testIDEA57338() { doTest(LanguageLevel.JDK_1_6, JavaSdkVersion.JDK_1_6, false); }
|
||||
public void testIDEA67600() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
public void testIDEA126633() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
//jdk should propagate LL 1.4 but actually it provides LL 1.7?!
|
||||
public void testCastObjectToIntJdk14() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_4, false); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user