[Analysis API] fix "Unexpected class FirTypeProjectionWithVarianceImpl" exception
from KtFirExpressionTypeProvider.getKtExpressionType ^KTIJ-23432 fixed
This commit is contained in:
+3
@@ -83,6 +83,9 @@ internal class KtFirExpressionTypeProvider(
|
||||
// `false` does not have a corresponding elements on the FIR side and hence the containing `FirWhenBranch` is returned. In this
|
||||
// case, we simply report null since FIR does not know about it.
|
||||
is FirWhenBranch -> null
|
||||
|
||||
// `listOf<_>(1)` where `expression` is `_`
|
||||
is FirPlaceholderProjection -> null
|
||||
else -> error("Unexpected ${fir?.let { it::class }} for ${expression::class} with text `${expression.text}`")
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -232,6 +232,12 @@ public class FirIdeDependentAnalysisSourceModuleHLExpressionTypeTestGenerated ex
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expressionType/stringLiteral.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("underscoreTypeArgument.kt")
|
||||
public void testUnderscoreTypeArgument() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expressionType/underscoreTypeArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unresolvedSuper_multipleSuperTypes.kt")
|
||||
public void testUnresolvedSuper_multipleSuperTypes() throws Exception {
|
||||
|
||||
+6
@@ -232,6 +232,12 @@ public class FirIdeNormalAnalysisSourceModuleHLExpressionTypeTestGenerated exten
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expressionType/stringLiteral.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("underscoreTypeArgument.kt")
|
||||
public void testUnderscoreTypeArgument() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expressionType/underscoreTypeArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unresolvedSuper_multipleSuperTypes.kt")
|
||||
public void testUnresolvedSuper_multipleSuperTypes() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user