mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
fix comparison level when checking type arguments applicability (IDEA-132063)
This commit is contained in:
@@ -384,7 +384,7 @@ public class TypeConversionUtil {
|
||||
return aClass != null &&
|
||||
bClass != null &&
|
||||
aClass.getManager().areElementsEquivalent(aClass, bClass) &&
|
||||
areSameArgumentTypes(aClass, resolveResult1.getSubstitutor(), resolveResult2.getSubstitutor());
|
||||
areSameArgumentTypes(aClass, resolveResult1.getSubstitutor(), resolveResult2.getSubstitutor(), 1);
|
||||
}
|
||||
|
||||
private static boolean areSameArgumentTypes(@NotNull PsiClass aClass, @NotNull PsiSubstitutor substitutor1, @NotNull PsiSubstitutor substitutor2) {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class ImmutableSet<E> {
|
||||
void foo(final ImmutableSet<Class<String>> of) {
|
||||
Object types = <error descr="Inconvertible types; cannot cast 'ImmutableSet<java.lang.Class<java.lang.String>>' to 'ImmutableSet<java.lang.Class<?>>'">(ImmutableSet<Class<?>>) of</error>;
|
||||
}
|
||||
}
|
||||
@@ -430,6 +430,10 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false);
|
||||
}
|
||||
|
||||
public void testNestedLevelsToCheckTypeArguments() throws Exception {
|
||||
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()));
|
||||
assertNotNull(collectionsClass);
|
||||
|
||||
Reference in New Issue
Block a user