Don't assign type parameters from original proto if type is substituted with Any (KT-15128)
#KT-15128 Fixed
This commit is contained in:
+7
-3
@@ -141,10 +141,12 @@ fun createStubForPackageName(packageDirectiveStub: KotlinPlaceHolderStubImpl<KtP
|
||||
fun createStubForTypeName(
|
||||
typeClassId: ClassId,
|
||||
parent: StubElement<out PsiElement>,
|
||||
onUserTypeLevel: (KotlinUserTypeStub, Int) -> Unit = { x, y -> }
|
||||
bindTypeArguments: (KotlinUserTypeStub, Int) -> Unit = { x, y -> }
|
||||
): KotlinUserTypeStub {
|
||||
val substituteWithAny = typeClassId.isLocal
|
||||
|
||||
val fqName =
|
||||
if (typeClassId.isLocal) KotlinBuiltIns.FQ_NAMES.any
|
||||
if (substituteWithAny) KotlinBuiltIns.FQ_NAMES.any
|
||||
else typeClassId.asSingleFqName().toUnsafe()
|
||||
val segments = fqName.pathSegments().asReversed()
|
||||
assert(segments.isNotEmpty())
|
||||
@@ -156,7 +158,9 @@ fun createStubForTypeName(
|
||||
recCreateStubForType(userTypeStub, level + 1)
|
||||
}
|
||||
KotlinNameReferenceExpressionStubImpl(userTypeStub, lastSegment.ref())
|
||||
onUserTypeLevel(userTypeStub, level)
|
||||
if (!substituteWithAny) {
|
||||
bindTypeArguments(userTypeStub, level)
|
||||
}
|
||||
return userTypeStub
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user