[FIR] Minor refactoring: createFunctionConsumer

This commit is contained in:
Mikhail Glukhikh
2020-01-10 13:26:32 +03:00
parent 02a57aab7d
commit f07adf085c
2 changed files with 7 additions and 13 deletions
@@ -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,
@@ -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(