[AA] include inferred types in functional exp expected type
Fixed for K2 only, k1 remains as is ^KT-62466 fixed
This commit is contained in:
+4
-1
@@ -223,7 +223,10 @@ internal class KtFirExpressionTypeProvider(
|
||||
|
||||
val callee = (firCall.calleeReference as? FirResolvedNamedReference)?.resolvedSymbol
|
||||
if (callee?.fir?.origin == FirDeclarationOrigin.SamConstructor) {
|
||||
return (callee.fir as FirSimpleFunction).returnTypeRef.coneType.asKtType()
|
||||
val substitutor = (firCall as? FirQualifiedAccessExpression)
|
||||
?.createConeSubstitutorFromTypeArguments(discardErrorTypes = true)
|
||||
?: ConeSubstitutor.Empty
|
||||
return substitutor.substituteOrSelf((callee.fir as FirSimpleFunction).returnTypeRef.coneType).asKtType()
|
||||
}
|
||||
|
||||
val argumentsToParameters = firCall.argumentsToSubstitutedValueParameters(substituteWithErrorTypes = false) ?: return null
|
||||
|
||||
+6
@@ -184,6 +184,12 @@ public class FirIdeDependentAnalysisSourceModuleExpectedExpressionTypeTestGenera
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expectedExpressionType/functionPositionalParamQualified.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionalTypeSubstitution.kt")
|
||||
public void testFunctionalTypeSubstitution() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expectedExpressionType/functionalTypeSubstitution.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifCondition.kt")
|
||||
public void testIfCondition() throws Exception {
|
||||
|
||||
+6
@@ -184,6 +184,12 @@ public class FirIdeNormalAnalysisSourceModuleExpectedExpressionTypeTestGenerated
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expectedExpressionType/functionPositionalParamQualified.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionalTypeSubstitution.kt")
|
||||
public void testFunctionalTypeSubstitution() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/expressionTypeProvider/expectedExpressionType/functionalTypeSubstitution.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifCondition.kt")
|
||||
public void testIfCondition() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user