Refactoring: moved code

Moved check for not generic call to CandidateResolver
This commit is contained in:
Svetlana Isakova
2014-04-19 09:15:20 +04:00
parent efa00782a4
commit f03f9684ad
2 changed files with 7 additions and 10 deletions
@@ -411,14 +411,6 @@ public class CallResolver {
ResolvedCallWithTrace<D> resolvedCall = results.getResultingCall();
ResolvedCallImpl<D> callToCompleteInference = resolvedCall.getCallToCompleteTypeArgumentInference();
if (!callToCompleteInference.hasIncompleteTypeParameters()) {
CallCandidateResolutionContext<D> callCandidateResolutionContext =
CallCandidateResolutionContext.createForCallBeingAnalyzed(callToCompleteInference, context, tracing);
candidateResolver.completeNestedCallsInference(callCandidateResolutionContext);
candidateResolver.checkValueArgumentTypes(callCandidateResolutionContext);
return results;
}
CallCandidateResolutionContext<D> callCandidateResolutionContext =
CallCandidateResolutionContext.createForCallBeingAnalyzed(callToCompleteInference, context, tracing);
candidateResolver.completeTypeInferenceDependentOnExpectedTypeForCall(callCandidateResolutionContext, false);
@@ -426,7 +418,7 @@ public class CallResolver {
if (callToCompleteInference.getStatus().isSuccess()) {
return OverloadResolutionResultsImpl.success(resolvedCall);
}
return OverloadResolutionResultsImpl.incompleteTypeInference(resolvedCall);
return results;
}
private static <F extends CallableDescriptor> void cacheResults(
@@ -221,7 +221,12 @@ public class CandidateResolver {
boolean isInnerCall
) {
ResolvedCallImpl<D> resolvedCall = context.candidateCall;
assert resolvedCall.hasIncompleteTypeParameters();
if (!resolvedCall.hasIncompleteTypeParameters()) {
completeNestedCallsInference(context);
checkValueArgumentTypes(context);
return resolvedCall.getResultingDescriptor().getReturnType();
}
assert resolvedCall.getConstraintSystem() != null;
JetType unsubstitutedReturnType = resolvedCall.getCandidateDescriptor().getReturnType();