From d8df177b83685d8fd211ccf033ea47fcbce45744 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Tue, 19 Oct 2021 23:20:29 -0700 Subject: [PATCH] FIR LC: fix return type of suspend function --- .../symbol/methods/FirLightSimpleMethodForSymbol.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/analysis/symbol-light-classes/src/org/jetbrains/kotlin/light/classes/symbol/methods/FirLightSimpleMethodForSymbol.kt b/analysis/symbol-light-classes/src/org/jetbrains/kotlin/light/classes/symbol/methods/FirLightSimpleMethodForSymbol.kt index 132e443cc5e..cdcffcfaac9 100644 --- a/analysis/symbol-light-classes/src/org/jetbrains/kotlin/light/classes/symbol/methods/FirLightSimpleMethodForSymbol.kt +++ b/analysis/symbol-light-classes/src/org/jetbrains/kotlin/light/classes/symbol/methods/FirLightSimpleMethodForSymbol.kt @@ -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