[AA LC] Create proper Psi types for types with errors inside

This commit is contained in:
Dmitriy Novozhilov
2022-09-21 16:13:30 +03:00
committed by Space Team
parent 3a536bb32f
commit a3b9f15ecc
18 changed files with 51 additions and 26 deletions
@@ -30,7 +30,7 @@ abstract class AbstractAnalysisApiExpressionPsiTypeProviderTest : AbstractAnalys
val actual = analyze(ktFile) {
val returnType = declarationAtCaret.getKtType()
?: error("Not a typable expression ${declarationAtCaret::class} ${declarationAtCaret.text}")
val psiType = returnType.asPsiType(psiContext)
val psiType = returnType.asPsiType(psiContext, allowErrorTypes = false)
buildString {
appendLine("KtType: ${returnType.render(position = Variance.INVARIANT)}")
appendLine("PsiType: $psiType")
@@ -39,11 +39,11 @@ abstract class AbstractAnalysisApiPsiTypeProviderTest : AbstractAnalysisApiBased
analyze(declaration) {
val ktType = declaration.getReturnKtType()
appendLine("KtType: ${ktType.render(position = Variance.INVARIANT)}")
appendLine("PsiType: ${ktType.asPsiType(psiContext)}")
appendLine("PsiType: ${ktType.asPsiType(psiContext, allowErrorTypes = false)}")
}
}
}
testServices.assertions.assertEqualsToTestDataFileSibling(actual)
}
}
}