From f03f9684adbb4cde21c1af86141650454ed2489e Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Sat, 19 Apr 2014 09:15:20 +0400 Subject: [PATCH] Refactoring: moved code Moved check for not generic call to CandidateResolver --- .../jetbrains/jet/lang/resolve/calls/CallResolver.java | 10 +--------- .../jet/lang/resolve/calls/CandidateResolver.java | 7 ++++++- 2 files changed, 7 insertions(+), 10 deletions(-) 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 690fc864fd6..db57ef77340 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 @@ -411,14 +411,6 @@ public class CallResolver { ResolvedCallWithTrace resolvedCall = results.getResultingCall(); ResolvedCallImpl callToCompleteInference = resolvedCall.getCallToCompleteTypeArgumentInference(); - if (!callToCompleteInference.hasIncompleteTypeParameters()) { - CallCandidateResolutionContext callCandidateResolutionContext = - CallCandidateResolutionContext.createForCallBeingAnalyzed(callToCompleteInference, context, tracing); - candidateResolver.completeNestedCallsInference(callCandidateResolutionContext); - candidateResolver.checkValueArgumentTypes(callCandidateResolutionContext); - return results; - } - CallCandidateResolutionContext 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 void cacheResults( diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CandidateResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CandidateResolver.java index 1f11ab5af40..440dee89806 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CandidateResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CandidateResolver.java @@ -221,7 +221,12 @@ public class CandidateResolver { boolean isInnerCall ) { ResolvedCallImpl 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();