diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java index 6f907597877..c89a5d64fdc 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java @@ -368,26 +368,25 @@ public class CallResolver { if (!results.isSingleResult()) return results; - ResolvedCallImpl resolvedCall = results.getResultingCall().getCallToCompleteTypeArgumentInference(); + ResolvedCallWithTrace resolvedCall = results.getResultingCall(); + ResolvedCallImpl callToCompleteInference = resolvedCall.getCallToCompleteTypeArgumentInference(); - if (!resolvedCall.hasIncompleteTypeParameters()) { + if (!callToCompleteInference.hasIncompleteTypeParameters()) { CallCandidateResolutionContext callCandidateResolutionContext = - CallCandidateResolutionContext.createForCallBeingAnalyzed(resolvedCall, context, tracing); + CallCandidateResolutionContext.createForCallBeingAnalyzed(callToCompleteInference, context, tracing); candidateResolver.completeNestedCallsInference(callCandidateResolutionContext); candidateResolver.checkValueArgumentTypes(callCandidateResolutionContext); return results; } - ResolvedCallImpl copy = CallResolverUtil.copy(resolvedCall); - context.trace.record(RESOLVED_CALL, context.call.getCalleeExpression(), copy); CallCandidateResolutionContext callCandidateResolutionContext = - CallCandidateResolutionContext.createForCallBeingAnalyzed(copy, context, tracing); + CallCandidateResolutionContext.createForCallBeingAnalyzed(callToCompleteInference, context, tracing); candidateResolver.completeTypeInferenceDependentOnExpectedTypeForCall(callCandidateResolutionContext, false); - if (copy.getStatus().isSuccess()) { - return OverloadResolutionResultsImpl.success(copy); + if (callToCompleteInference.getStatus().isSuccess()) { + return OverloadResolutionResultsImpl.success(resolvedCall); } - return OverloadResolutionResultsImpl.incompleteTypeInference(copy); + return OverloadResolutionResultsImpl.incompleteTypeInference(resolvedCall); } private static void cacheResults( diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolverUtil.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolverUtil.java index dd7ecc049eb..34d8a253ce4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolverUtil.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolverUtil.java @@ -52,29 +52,6 @@ public class CallResolverUtil { private CallResolverUtil() {} - public static ResolvedCallImpl copy(@NotNull ResolvedCallImpl call) { - ResolutionCandidate candidate = ResolutionCandidate.create(call.getCandidateDescriptor(), call.getThisObject(), - call.getReceiverArgument(), call.getExplicitReceiverKind(), - call.isSafeCall()); - - ResolvedCallImpl copy = ResolvedCallImpl.create( - candidate, TraceUtil.DELEGATING_TRACE_STUB, call.getTracing(), call.getDataFlowInfoForArguments()); - - copy.addStatus(call.getStatus()); - if (call.isDirty()) { - copy.argumentHasNoType(); - } - copy.setHasUnknownTypeParameters(call.hasIncompleteTypeParameters()); - ConstraintSystem constraintSystem = call.getConstraintSystem(); - if (constraintSystem != null) { - copy.setConstraintSystem(constraintSystem.copy()); - } - for (Map.Entry entry : call.getValueArguments().entrySet()) { - copy.recordValueArgument(entry.getKey(), entry.getValue()); - } - return copy; - } - public static boolean hasUnknownFunctionParameter(@NotNull JetType type) { assert KotlinBuiltIns.getInstance().isFunctionOrExtensionFunctionType(type);