FIR LC: use optimal type mapping mode for return type
This commit is contained in:
committed by
Ilya Kirillov
parent
d3c34fa200
commit
0da9ef873a
+12
-3
@@ -34,10 +34,19 @@ internal class FirLightFieldForPropertySymbol(
|
||||
when {
|
||||
isDelegated ->
|
||||
(kotlinOrigin as? KtProperty)?.delegateExpression?.let {
|
||||
it.getKtType()?.asPsiType(this@FirLightFieldForPropertySymbol)
|
||||
val ktType = it.getKtType()
|
||||
ktType?.asPsiType(
|
||||
this@FirLightFieldForPropertySymbol,
|
||||
ktType.getOptimalModeForReturnType(containingClass.isAnnotationType)
|
||||
)
|
||||
}
|
||||
else ->
|
||||
propertySymbol.annotatedType.type.asPsiType(this@FirLightFieldForPropertySymbol)
|
||||
else -> {
|
||||
val ktType = propertySymbol.annotatedType.type
|
||||
ktType.asPsiType(
|
||||
this@FirLightFieldForPropertySymbol,
|
||||
ktType.getOptimalModeForReturnType(containingClass.isAnnotationType)
|
||||
)
|
||||
}
|
||||
}
|
||||
} ?: nonExistentType()
|
||||
}
|
||||
|
||||
+6
-3
@@ -150,9 +150,12 @@ internal class FirLightAccessorMethodForSymbol(
|
||||
private val _returnedType: PsiType by lazyPub {
|
||||
if (!isGetter) return@lazyPub PsiType.VOID
|
||||
analyzeWithSymbolAsContext(containingPropertySymbol) {
|
||||
containingPropertySymbol.annotatedType.type.asPsiType(this@FirLightAccessorMethodForSymbol)
|
||||
?: this@FirLightAccessorMethodForSymbol.nonExistentType()
|
||||
}
|
||||
val ktType = containingPropertySymbol.annotatedType.type
|
||||
ktType.asPsiType(
|
||||
this@FirLightAccessorMethodForSymbol,
|
||||
ktType.getOptimalModeForReturnType(containingClass.isAnnotationType)
|
||||
)
|
||||
} ?: nonExistentType()
|
||||
}
|
||||
|
||||
override fun getReturnType(): PsiType = _returnedType
|
||||
|
||||
+4
-1
@@ -145,7 +145,10 @@ internal class FirLightSimpleMethodForSymbol(
|
||||
else ->
|
||||
functionSymbol.annotatedType.type
|
||||
}
|
||||
ktType.asPsiType(this@FirLightSimpleMethodForSymbol)
|
||||
ktType.asPsiType(
|
||||
this@FirLightSimpleMethodForSymbol,
|
||||
ktType.getOptimalModeForReturnType(containingClass.isAnnotationType)
|
||||
)
|
||||
} ?: nonExistentType()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user