[FIR] Remove dead-code in transformFunctionCallInternal
Logic that was used to complete receiver expression is no longer needed
after the `invoke receiver completion` change:
7b46c59d57
Before that change, we could have generated a new receiver expression
during resolution in case of `call() -> call.<invoke>()` resolution,
Here - `call` is newly generated qualified access that wasn't completed.
We were detecting such situations by detecting change in the receiver
between original `call()` shape and output `___.invoke()` shape in
the expression.
After that change, we always complete the receiver of invoke during
`callResolver.resolveCallAndSelectCandidate`
So the logic that detects receiver mismatch and invokes receiver
completion after it isn't needed anymore
This commit is contained in:
committed by
Space Team
parent
72d048bd62
commit
b5ea059861
-6
@@ -420,7 +420,6 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
|
||||
functionCall.transformAnnotations(transformer, data)
|
||||
functionCall.replaceLambdaArgumentInvocationKinds(session)
|
||||
functionCall.transformTypeArguments(transformer, ResolutionMode.ContextIndependent)
|
||||
val initialExplicitReceiver = functionCall.explicitReceiver
|
||||
val withTransformedArguments = if (!resolvingAugmentedAssignment) {
|
||||
dataFlowAnalyzer.enterCallArguments(functionCall, functionCall.arguments)
|
||||
// In provideDelegate mode the explicitReceiver is already resolved
|
||||
@@ -438,11 +437,6 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
|
||||
functionCall
|
||||
}
|
||||
val resultExpression = callResolver.resolveCallAndSelectCandidate(withTransformedArguments)
|
||||
val resultExplicitReceiver = resultExpression.explicitReceiver?.unwrapSmartcastExpression()
|
||||
if (initialExplicitReceiver !== resultExplicitReceiver && resultExplicitReceiver is FirQualifiedAccessExpression) {
|
||||
// name.invoke() case
|
||||
callCompleter.completeCall(resultExplicitReceiver, ResolutionMode.ContextIndependent)
|
||||
}
|
||||
val completeInference = callCompleter.completeCall(resultExpression, data)
|
||||
val result = completeInference.transformToIntegerOperatorCallOrApproximateItIfNeeded(data)
|
||||
if (!resolvingAugmentedAssignment) {
|
||||
|
||||
Reference in New Issue
Block a user