FIR LC: fix return type of suspend function

This commit is contained in:
Jinseong Jeon
2021-10-19 23:20:29 -07:00
committed by Ilya Kirillov
parent 5ed9cac0cc
commit d8df177b83
@@ -130,9 +130,13 @@ internal class FirLightSimpleMethodForSymbol(
private val _returnedType: PsiType by lazyPub {
if (isVoidReturnType) return@lazyPub PsiType.VOID
analyzeWithSymbolAsContext(functionSymbol) {
functionSymbol.annotatedType.type.asPsiType(this@FirLightSimpleMethodForSymbol)
?: this@FirLightSimpleMethodForSymbol.nonExistentType()
}
val ktType =
if (functionSymbol.isSuspend)
analysisSession.builtinTypes.NULLABLE_ANY
else
functionSymbol.annotatedType.type
ktType.asPsiType(this@FirLightSimpleMethodForSymbol)
} ?: nonExistentType()
}
override fun getReturnType(): PsiType = _returnedType