Skip to content

Commit 2d1e408

Browse files
committed
[Diagnostics] Use solution for verify presence of fix in diagnoseUseOfReferenceEqualityOperator
1 parent b405f7c commit 2d1e408

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5560,11 +5560,14 @@ bool ArgumentMismatchFailure::diagnoseUseOfReferenceEqualityOperator() const {
55605560
// let's avoid producing a diagnostic second time, because first
55615561
// one would cover both arguments.
55625562
if (getAsExpr(getAnchor()) == rhs && rhsType->is<FunctionType>()) {
5563-
auto &cs = getConstraintSystem();
5564-
if (cs.hasFixFor(getConstraintLocator(
5565-
binaryOp, {ConstraintLocator::ApplyArgument,
5566-
LocatorPathElt::ApplyArgToParam(
5567-
0, 0, getParameterFlagsAtIndex(0))})))
5563+
auto *argLoc = getConstraintLocator(
5564+
binaryOp,
5565+
{ConstraintLocator::ApplyArgument,
5566+
LocatorPathElt::ApplyArgToParam(0, 0, getParameterFlagsAtIndex(0))});
5567+
5568+
if (llvm::any_of(getSolution().Fixes, [&argLoc](const ConstraintFix *fix) {
5569+
return fix->getLocator() == argLoc;
5570+
}))
55685571
return true;
55695572
}
55705573

0 commit comments

Comments
 (0)