From cedd98148c2aed5a02e5a9544b857e420af54c58 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Fri, 24 Dec 2021 12:47:53 +0300 Subject: [PATCH] [FE 1.0] Rename the remaining coroutine inference stuff into builder inference --- .../calls/tower/KotlinResolutionCallbacksImpl.kt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt index 22d841097c1..464ecce25d1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt @@ -197,7 +197,7 @@ class KotlinResolutionCallbacksImpl( val approximatesExpectedType = typeApproximator.approximateToSubType(expectedType, TypeApproximatorConfiguration.LocalDeclaration) ?: expectedType - val coroutineSession = + val builderInferenceSession = if (stubsForPostponedVariables.isNotEmpty()) { BuilderInferenceSession( psiCallResolver, postponedArgumentsAnalyzer, kotlinConstraintSystemCompleter, @@ -211,8 +211,8 @@ class KotlinResolutionCallbacksImpl( } - val temporaryTrace = if (coroutineSession != null) - TemporaryBindingTrace.create(trace, "Trace to resolve coroutine $lambdaArgument") + val temporaryTrace = if (builderInferenceSession != null) + TemporaryBindingTrace.create(trace, "Trace to resolve builder inference lambda: $lambdaArgument") else null @@ -223,14 +223,16 @@ class KotlinResolutionCallbacksImpl( .replaceContextDependency(lambdaInfo.contextDependency) .replaceExpectedType(approximatesExpectedType) .replaceDataFlowInfo(psiCallArgument.dataFlowInfoBeforeThisArgument).let { - if (coroutineSession != null) it.replaceInferenceSession(coroutineSession) else it + if (builderInferenceSession != null) it.replaceInferenceSession(builderInferenceSession) else it } val functionTypeInfo = expressionTypingServices.getTypeInfo(psiCallArgument.expression, actualContext) (temporaryTrace ?: trace).record(BindingContext.NEW_INFERENCE_LAMBDA_INFO, psiCallArgument.ktFunction, LambdaInfo.STUB_EMPTY) - if (coroutineSession?.hasInapplicableCall() == true) { - return ReturnArgumentsAnalysisResult(ReturnArgumentsInfo.empty, coroutineSession, hasInapplicableCallForBuilderInference = true) + if (builderInferenceSession?.hasInapplicableCall() == true) { + return ReturnArgumentsAnalysisResult( + ReturnArgumentsInfo.empty, builderInferenceSession, hasInapplicableCallForBuilderInference = true + ) } else { temporaryTrace?.commit() } @@ -277,7 +279,7 @@ class KotlinResolutionCallbacksImpl( lastExpressionCoercedToUnit, returnArgumentFound ), - coroutineSession, + builderInferenceSession, ) }