avoid creating intersections from unresolved classes

GitOrigin-RevId: 3df59f4427f120185f8da6744500530402fbbfc0
This commit is contained in:
Konstantin.Nisht
2019-10-09 14:08:11 +00:00
committed by intellij-monorepo-bot
parent 1da08c1dad
commit f0a1247707
4 changed files with 20 additions and 2 deletions
@@ -98,7 +98,8 @@ fun PsiType.forceWildcardsAsTypeArguments(): PsiType {
val resolvedClass = classType.resolve()
if (resolvedClass != null) {
return factory.createType(resolvedClass, *mappedParameters.toTypedArray())
} else {
}
else {
return PsiWildcardType.createUnbounded(manager)
}
}
@@ -243,7 +244,7 @@ fun PsiSubstitutor.removeForeignTypeParameters(method: GrMethod): PsiSubstitutor
}
override fun visitIntersectionType(intersectionType: PsiIntersectionType?): PsiType? {
return compress(intersectionType?.conjuncts?.filterNotNull()?.map { it.accept(this) })
return compress(intersectionType?.conjuncts?.filterNotNull()?.mapNotNull { it.accept(this) })
}
override fun visitWildcardType(wildcardType: PsiWildcardType?): PsiType? {
@@ -517,4 +517,7 @@ class AA { static void fo<caret>o(Integer a) {} }
doTest(true)
}
void testUnresolvedCode2() {
doTest(true)
}
}
@@ -0,0 +1,7 @@
def foo(a) {
}
def <T extends Serializable & Unresolved> void m() {
foo(null as T)
}
@@ -0,0 +1,7 @@
void foo(Object a) {
}
def <T extends Serializable & Unresolved> void m() {
foo(null as T)
}