small refactoring
removed unnecessary variable added annotation
This commit is contained in:
@@ -135,14 +135,13 @@ public class CallResolverUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasInferredReturnType(ResolvedCallWithTrace<?> call) {
|
public static boolean hasInferredReturnType(ResolvedCallWithTrace<?> call) {
|
||||||
boolean isKnownReturnType = true;
|
|
||||||
ResolvedCallImpl<?> callToComplete = call.getCallToCompleteTypeArgumentInference();
|
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'
|
// Expected type mismatch was reported before as 'TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH'
|
||||||
ConstraintSystem constraintSystem = callToComplete.getConstraintSystem();
|
ConstraintSystem constraintSystem = callToComplete.getConstraintSystem();
|
||||||
if (constraintSystem != null && constraintSystem.hasOnlyExpectedTypeMismatch()) { isKnownReturnType = false; }
|
if (constraintSystem != null && constraintSystem.hasOnlyExpectedTypeMismatch()) return false;
|
||||||
return isKnownReturnType;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ public class CandidateResolver {
|
|||||||
resolvedCall.setResultingSubstitutor(constraintSystem.getResultingSubstitutor());
|
resolvedCall.setResultingSubstitutor(constraintSystem.getResultingSubstitutor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
public <D extends CallableDescriptor> JetType completeTypeInferenceDependentOnExpectedTypeForCall(
|
public <D extends CallableDescriptor> JetType completeTypeInferenceDependentOnExpectedTypeForCall(
|
||||||
@NotNull CallCandidateResolutionContext<D> context,
|
@NotNull CallCandidateResolutionContext<D> context,
|
||||||
boolean isInnerCall
|
boolean isInnerCall
|
||||||
|
|||||||
Reference in New Issue
Block a user