Skip to content

Commit 587d297

Browse files
committed
[CSDiag] NFC: Remove obsolete fix-it for argument casts from visitApplyExpr
1 parent b0299f7 commit 587d297

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3675,45 +3675,6 @@ bool FailureDiagnosis::visitApplyExpr(ApplyExpr *callExpr) {
36753675
overloadName, lhsType, rhsType);
36763676
diag.highlight(lhsExpr->getSourceRange())
36773677
.highlight(rhsExpr->getSourceRange());
3678-
3679-
auto tryFixIts = [&]() -> bool {
3680-
if (calleeInfo.size() != 1)
3681-
return false;
3682-
3683-
auto candidate = calleeInfo[0];
3684-
auto *fnType = candidate.getFunctionType();
3685-
if (!fnType)
3686-
return false;
3687-
3688-
auto params = fnType->getParams();
3689-
if (params.size() != 2)
3690-
return false;
3691-
3692-
auto lhsCandidate = params[0].getOldType();
3693-
auto rhsCandidate = params[1].getOldType();
3694-
auto lhsIsCandidate = lhsType->isEqual(lhsCandidate);
3695-
auto rhsIsCandidate = rhsType->isEqual(rhsCandidate);
3696-
3697-
if (!lhsIsCandidate && !rhsIsCandidate)
3698-
return false;
3699-
3700-
if (!lhsIsCandidate) {
3701-
ContextualFailure failure(expr, CS, lhsType, lhsCandidate,
3702-
CS.getConstraintLocator(lhsExpr));
3703-
return failure.tryIntegerCastFixIts(diag);
3704-
}
3705-
3706-
if (!rhsIsCandidate) {
3707-
ContextualFailure failure(expr, CS, rhsType, rhsCandidate,
3708-
CS.getConstraintLocator(rhsExpr));
3709-
return failure.tryIntegerCastFixIts(diag);
3710-
}
3711-
3712-
return false;
3713-
};
3714-
3715-
tryFixIts();
3716-
37173678
} else {
37183679
diagnose(callExpr->getLoc(), diag::cannot_apply_binop_to_same_args,
37193680
overloadName, lhsType)

0 commit comments

Comments
 (0)