FIR LC: approximate local type only if it's necessary and out of scope
This commit is contained in:
committed by
Roman Golyshev
parent
9ed2c9d371
commit
9524825662
+3
-3
@@ -30,14 +30,14 @@ internal class KtFe10PsiTypeProvider(override val analysisSession: KtFe10Analysi
|
||||
|
||||
private val typeMapper by lazy { KtFe10JvmTypeMapperContext(analysisSession.resolveSession) }
|
||||
|
||||
override fun asPsiType(type: KtType, context: PsiElement, mode: TypeMappingMode): PsiType? = withValidityAssertion {
|
||||
override fun asPsiType(type: KtType, useSitePosition: PsiElement, mode: TypeMappingMode): PsiType? = withValidityAssertion {
|
||||
val kotlinType = (type as KtFe10Type).type
|
||||
|
||||
if (kotlinType.isError || kotlinType.arguments.any { !it.isStarProjection && it.type.isError }) {
|
||||
return null
|
||||
}
|
||||
|
||||
return asPsiType(simplifyType(kotlinType), context, mode)
|
||||
return asPsiType(simplifyType(kotlinType), useSitePosition, mode)
|
||||
}
|
||||
|
||||
private fun simplifyType(type: UnwrappedType): KotlinType {
|
||||
@@ -72,4 +72,4 @@ internal class KtFe10PsiTypeProvider(override val analysisSession: KtFe10Analysi
|
||||
val typeElement = ClsTypeElementImpl(context, typeText, '\u0000')
|
||||
return typeElement.type
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user