From c699896b0f304bf81d6b1cfff476a17425b77148 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 12 Sep 2022 11:28:39 +0200 Subject: [PATCH] Revert "[FE 1.0] Resolve collection literals through the new type inference infra" This reverts commit a542de715a7d56d72a0434e34901acb50ea6ade9. --- .../kotlin/resolve/calls/CallResolver.java | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java index 2dd4f54bab8..06695680822 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java @@ -261,21 +261,16 @@ public class CallResolver { @NotNull Collection functionDescriptors ) { BasicCallResolutionContext callResolutionContext = BasicCallResolutionContext.create(context, call, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS); + List> candidates = CollectionsKt.map(functionDescriptors, descriptor -> + OldResolutionCandidate.create( + call, + descriptor, + null, + ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, + null)); - OverloadResolutionResults resolutionResults = PSICallResolver.runResolutionAndInferenceForGivenDescriptors( - callResolutionContext, - functionDescriptors, - TracingStrategyImpl.create(expression, call), - null, - null - ); - - if (resolutionResults.isSingleResult()) { - context.trace.record(BindingContext.RESOLVED_CALL, call, resolutionResults.getResultingCall()); - context.trace.record(BindingContext.CALL, call.getCallElement(), call); - } - - return resolutionResults; + return computeTasksFromCandidatesAndResolvedCall( + callResolutionContext, candidates, TracingStrategyImpl.create(expression, call)); } @NotNull