Skip to content

Commit 0103fe1

Browse files
authored
Merge pull request swiftlang#28265 from DougGregor/diagnose-ambiguity-with-fixes-without-expr
2 parents 3146197 + 4c2a7bf commit 0103fe1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ bool MissingConformanceFailure::diagnoseAsAmbiguousOperatorRef() {
680680
// about missing conformance just in case.
681681
auto operatorID = name.getIdentifier();
682682

683-
auto *applyExpr = cast_or_null<ApplyExpr>(findParentExpr(anchor));
683+
auto *applyExpr = cast<ApplyExpr>(findParentExpr(anchor));
684684
if (auto *binaryOp = dyn_cast<BinaryExpr>(applyExpr)) {
685685
auto lhsType = getType(binaryOp->getArg()->getElement(0));
686686
auto rhsType = getType(binaryOp->getArg()->getElement(1));

lib/Sema/ConstraintSystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,7 @@ bool ConstraintSystem::salvage(SmallVectorImpl<Solution> &viable, Expr *expr) {
24252425

24262426
// Before removing any "fixed" solutions, let's check
24272427
// if ambiguity is caused by fixes and diagnose if possible.
2428-
if (diagnoseAmbiguityWithFixes(expr, viable))
2428+
if (diagnoseAmbiguityWithFixes(viable))
24292429
return true;
24302430

24312431
// FIXME: If we were able to actually fix things along the way,
@@ -2529,7 +2529,7 @@ static void diagnoseOperatorAmbiguity(ConstraintSystem &cs,
25292529
}
25302530

25312531
bool ConstraintSystem::diagnoseAmbiguityWithFixes(
2532-
Expr *expr, ArrayRef<Solution> solutions) {
2532+
ArrayRef<Solution> solutions) {
25332533
if (solutions.empty())
25342534
return false;
25352535

lib/Sema/ConstraintSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ class ConstraintSystem {
21082108
void diagnoseFailureForExpr(Expr *expr);
21092109

21102110
bool diagnoseAmbiguity(Expr *expr, ArrayRef<Solution> solutions);
2111-
bool diagnoseAmbiguityWithFixes(Expr *expr, ArrayRef<Solution> solutions);
2111+
bool diagnoseAmbiguityWithFixes(ArrayRef<Solution> solutions);
21122112

21132113
/// Give the deprecation warning for referring to a global function
21142114
/// when there's a method from a conditional conformance in a smaller/closer

0 commit comments

Comments
 (0)