From a542de715a7d56d72a0434e34901acb50ea6ade9 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Wed, 1 Jun 2022 13:21:45 +0200 Subject: [PATCH] [FE 1.0] Resolve collection literals through the new type inference infra ^KT-48961 In progress --- .../kotlin/resolve/calls/CallResolver.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 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 06695680822..2dd4f54bab8 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java @@ -261,16 +261,21 @@ 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)); - return computeTasksFromCandidatesAndResolvedCall( - callResolutionContext, candidates, TracingStrategyImpl.create(expression, call)); + 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; } @NotNull