removed CallResolverUtil.copy
This commit is contained in:
@@ -368,26 +368,25 @@ public class CallResolver {
|
|||||||
|
|
||||||
if (!results.isSingleResult()) return results;
|
if (!results.isSingleResult()) return results;
|
||||||
|
|
||||||
ResolvedCallImpl<D> resolvedCall = results.getResultingCall().getCallToCompleteTypeArgumentInference();
|
ResolvedCallWithTrace<D> resolvedCall = results.getResultingCall();
|
||||||
|
ResolvedCallImpl<D> callToCompleteInference = resolvedCall.getCallToCompleteTypeArgumentInference();
|
||||||
|
|
||||||
if (!resolvedCall.hasIncompleteTypeParameters()) {
|
if (!callToCompleteInference.hasIncompleteTypeParameters()) {
|
||||||
CallCandidateResolutionContext<D> callCandidateResolutionContext =
|
CallCandidateResolutionContext<D> callCandidateResolutionContext =
|
||||||
CallCandidateResolutionContext.createForCallBeingAnalyzed(resolvedCall, context, tracing);
|
CallCandidateResolutionContext.createForCallBeingAnalyzed(callToCompleteInference, context, tracing);
|
||||||
candidateResolver.completeNestedCallsInference(callCandidateResolutionContext);
|
candidateResolver.completeNestedCallsInference(callCandidateResolutionContext);
|
||||||
candidateResolver.checkValueArgumentTypes(callCandidateResolutionContext);
|
candidateResolver.checkValueArgumentTypes(callCandidateResolutionContext);
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
ResolvedCallImpl<D> copy = CallResolverUtil.copy(resolvedCall);
|
|
||||||
context.trace.record(RESOLVED_CALL, context.call.getCalleeExpression(), copy);
|
|
||||||
|
|
||||||
CallCandidateResolutionContext<D> callCandidateResolutionContext =
|
CallCandidateResolutionContext<D> callCandidateResolutionContext =
|
||||||
CallCandidateResolutionContext.createForCallBeingAnalyzed(copy, context, tracing);
|
CallCandidateResolutionContext.createForCallBeingAnalyzed(callToCompleteInference, context, tracing);
|
||||||
candidateResolver.completeTypeInferenceDependentOnExpectedTypeForCall(callCandidateResolutionContext, false);
|
candidateResolver.completeTypeInferenceDependentOnExpectedTypeForCall(callCandidateResolutionContext, false);
|
||||||
|
|
||||||
if (copy.getStatus().isSuccess()) {
|
if (callToCompleteInference.getStatus().isSuccess()) {
|
||||||
return OverloadResolutionResultsImpl.success(copy);
|
return OverloadResolutionResultsImpl.success(resolvedCall);
|
||||||
}
|
}
|
||||||
return OverloadResolutionResultsImpl.incompleteTypeInference(copy);
|
return OverloadResolutionResultsImpl.incompleteTypeInference(resolvedCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <F extends CallableDescriptor> void cacheResults(
|
private static <F extends CallableDescriptor> void cacheResults(
|
||||||
|
|||||||
@@ -52,29 +52,6 @@ public class CallResolverUtil {
|
|||||||
|
|
||||||
private CallResolverUtil() {}
|
private CallResolverUtil() {}
|
||||||
|
|
||||||
public static <D extends CallableDescriptor> ResolvedCallImpl<D> copy(@NotNull ResolvedCallImpl<D> call) {
|
|
||||||
ResolutionCandidate<D> candidate = ResolutionCandidate.create(call.getCandidateDescriptor(), call.getThisObject(),
|
|
||||||
call.getReceiverArgument(), call.getExplicitReceiverKind(),
|
|
||||||
call.isSafeCall());
|
|
||||||
|
|
||||||
ResolvedCallImpl<D> 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<ValueParameterDescriptor, ResolvedValueArgument> entry : call.getValueArguments().entrySet()) {
|
|
||||||
copy.recordValueArgument(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
return copy;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static boolean hasUnknownFunctionParameter(@NotNull JetType type) {
|
public static boolean hasUnknownFunctionParameter(@NotNull JetType type) {
|
||||||
assert KotlinBuiltIns.getInstance().isFunctionOrExtensionFunctionType(type);
|
assert KotlinBuiltIns.getInstance().isFunctionOrExtensionFunctionType(type);
|
||||||
|
|||||||
Reference in New Issue
Block a user