From f07adf085c1faf839ee1a518ed5fe4d2e649d716 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 10 Jan 2020 13:26:32 +0300 Subject: [PATCH] [FIR] Minor refactoring: createFunctionConsumer --- .../kotlin/fir/resolve/calls/Candidate.kt | 6 ++++++ .../kotlin/fir/resolve/calls/ConsumerFactories.kt | 14 +------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt index 77181343bb8..a4b26d5bd75 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt @@ -43,6 +43,12 @@ class CallInfo( ) { val argumentCount get() = arguments.size + fun replaceWithVariableAccess(): CallInfo = + CallInfo( + CallKind.VariableAccess, explicitReceiver, emptyList(), + isSafeCall, typeArguments, session, containingFile, implicitReceiverStack, expectedType, outerCSBuilder, lhs + ) + fun replaceExplicitReceiver(explicitReceiver: FirExpression): CallInfo = CallInfo( callKind, explicitReceiver, arguments, diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ConsumerFactories.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ConsumerFactories.kt index 91d9e0563bc..b5a0c42d689 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ConsumerFactories.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ConsumerFactories.kt @@ -63,19 +63,7 @@ fun createFunctionConsumer( resultCollector: CandidateCollector, towerResolver: FirTowerResolver ): TowerDataConsumer { - val varCallInfo = CallInfo( - CallKind.VariableAccess, - callInfo.explicitReceiver, - emptyList(), - callInfo.isSafeCall, - callInfo.typeArguments, - bodyResolveComponents.session, - callInfo.containingFile, - callInfo.implicitReceiverStack, - callInfo.expectedType, - callInfo.outerCSBuilder, - callInfo.lhs - ) + val varCallInfo = callInfo.replaceWithVariableAccess() return PrioritizedTowerDataConsumer( resultCollector, createSimpleConsumer(