[Analysis API FIR]: fix a freeze on rendering of invalid type arguments

^KT-61750 fixed
This commit is contained in:
Ilya Kirillov
2023-09-06 13:46:10 +02:00
committed by Space Team
parent b41e5abcfa
commit 209d59440b
8 changed files with 47 additions and 2 deletions
@@ -246,5 +246,11 @@ public class Fe10IdeNormalAnalysisSourceModuleRendererTestGenerated extends Abst
public void testContextFunctionTypes() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/contextFunctionTypes.kt");
}
@Test
@TestMetadata("extraTypeArguments.kt")
public void testExtraTypeArguments() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/extraTypeArguments.kt");
}
}
}
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.fir.types.toConeTypeProjection
internal object ErrorClassTypeQualifierBuilder {
fun createQualifiersForUnresolvedType(
coneDiagnostic: ConeUnresolvedError,
builder: KtSymbolByFirBuilder
builder: KtSymbolByFirBuilder,
): List<KtClassTypeQualifier> {
return when (coneDiagnostic) {
is ConeUnresolvedTypeQualifierError ->
@@ -53,7 +53,7 @@ internal object ErrorClassTypeQualifierBuilder {
firSymbol: FirClassLikeSymbol<*>,
builder: KtSymbolByFirBuilder
): List<KtClassTypeQualifier.KtResolvedClassTypeQualifier> {
return generateSequence(firSymbol) { firSymbol.getContainingClassSymbol(builder.rootSession) }.mapTo(mutableListOf()) { classSymbol ->
return generateSequence(firSymbol) { it.getContainingClassSymbol(builder.rootSession) }.mapTo(mutableListOf()) { classSymbol ->
KtClassTypeQualifier.KtResolvedClassTypeQualifier(
builder.classifierBuilder.buildClassLikeSymbol(classSymbol),
emptyList(),
@@ -246,5 +246,11 @@ public class FirIdeDependentAnalysisSourceModuleRendererTestGenerated extends Ab
public void testContextFunctionTypes() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/contextFunctionTypes.kt");
}
@Test
@TestMetadata("extraTypeArguments.kt")
public void testExtraTypeArguments() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/extraTypeArguments.kt");
}
}
}
@@ -246,5 +246,11 @@ public class FirIdeNormalAnalysisSourceModuleRendererTestGenerated extends Abstr
public void testContextFunctionTypes() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/contextFunctionTypes.kt");
}
@Test
@TestMetadata("extraTypeArguments.kt")
public void testExtraTypeArguments() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/extraTypeArguments.kt");
}
}
}
@@ -246,5 +246,11 @@ public class FirStandaloneNormalAnalysisSourceModuleRendererTestGenerated extend
public void testContextFunctionTypes() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/contextFunctionTypes.kt");
}
@Test
@TestMetadata("extraTypeArguments.kt")
public void testExtraTypeArguments() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/extraTypeArguments.kt");
}
}
}
@@ -0,0 +1,7 @@
interface AAA<T> {
class BBB : AAA<Int>
}
fun foo(): ERROR
@@ -0,0 +1,9 @@
import AAA.BBB
public interface AAA<T> {
class BBB : AAA<Int>
}
fun foo() : BBB<*> {
}
@@ -0,0 +1,5 @@
interface AAA<T> {
class BBB : AAA<Int>
}
fun foo(): BBB.AAA