[FIR] Resolve arguments of error types during type resolution

This commit is contained in:
Dmitriy Novozhilov
2022-09-23 14:46:01 +03:00
committed by Space Team
parent bc93556dbb
commit bd26c29229
13 changed files with 109 additions and 63 deletions
@@ -1,2 +1,2 @@
KtType: suspend (kotlin.Int) -> kotlin.Unit
PsiType: PsiType:Function2<? super Integer, ? super NonExistentClass, ? extends Object>
PsiType: PsiType:Function2<? super Integer, ? super NonExistentClass<Unit>, ? extends Object>
@@ -1,2 +1,2 @@
Resolved to:
0: (in Controller) suspend fun suspendHere(x: ERROR_TYPE(Symbol not found for Continuation))
0: (in Controller) suspend fun suspendHere(x: ERROR_TYPE(Symbol not found for Continuation))
@@ -12,11 +12,12 @@ import org.jetbrains.kotlin.analysis.api.KtAllowAnalysisOnEdt
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
import org.jetbrains.kotlin.analysis.api.analyze
import org.jetbrains.kotlin.analysis.api.lifetime.allowAnalysisOnEdt
import org.jetbrains.kotlin.builtins.StandardNames
import org.jetbrains.kotlin.analysis.project.structure.KtModule
import org.jetbrains.kotlin.psi.KtElement
internal fun PsiElement.nonExistentType(): PsiType =
JavaPsiFacade.getElementFactory(project).createTypeFromText("error.NonExistentClass", this)
JavaPsiFacade.getElementFactory(project).createTypeFromText(StandardNames.NON_EXISTENT_CLASS.asString(), this)
@OptIn(KtAllowAnalysisOnEdt::class)
private inline fun <E> allowLightClassesOnEdt(crossinline action: () -> E): E = allowAnalysisOnEdt(action)