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 a6c8c1de59c..d1dd55523af 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 @@ -135,14 +135,13 @@ public class CallResolverUtil { } public static boolean hasInferredReturnType(ResolvedCallWithTrace call) { - boolean isKnownReturnType = true; ResolvedCallImpl callToComplete = call.getCallToCompleteTypeArgumentInference(); - if (hasReturnTypeDependentOnNotInferredParams(callToComplete)) { isKnownReturnType = false; } + if (hasReturnTypeDependentOnNotInferredParams(callToComplete)) return false; // Expected type mismatch was reported before as 'TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH' ConstraintSystem constraintSystem = callToComplete.getConstraintSystem(); - if (constraintSystem != null && constraintSystem.hasOnlyExpectedTypeMismatch()) { isKnownReturnType = false; } - return isKnownReturnType; + if (constraintSystem != null && constraintSystem.hasOnlyExpectedTypeMismatch()) return false; + return true; } @Nullable 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 8b3cb8e50ab..44538203e55 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 @@ -216,6 +216,7 @@ public class CandidateResolver { resolvedCall.setResultingSubstitutor(constraintSystem.getResultingSubstitutor()); } + @Nullable public JetType completeTypeInferenceDependentOnExpectedTypeForCall( @NotNull CallCandidateResolutionContext context, boolean isInnerCall