Skip to content

Commit e512473

Browse files
committed
[Diagnostics] Use IgnoreContextualType fix for mismatches between ternary branch and contextual type
1 parent 06a762b commit e512473

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4909,7 +4909,7 @@ bool ConstraintSystem::repairFailures(
49094909
if (contextualType->isEqual(rhs)) {
49104910
auto *loc = getConstraintLocator(
49114911
anchor, LocatorPathElt::ContextualType(purpose));
4912-
if (hasFixFor(loc, FixKind::ContextualMismatch))
4912+
if (hasFixFor(loc, FixKind::IgnoreContextualType))
49134913
return true;
49144914

49154915
if (contextualType->isVoid() && purpose == CTP_ReturnStmt) {
@@ -4918,7 +4918,7 @@ bool ConstraintSystem::repairFailures(
49184918
}
49194919

49204920
conversionsOrFixes.push_back(
4921-
ContextualMismatch::create(*this, lhs, rhs, loc));
4921+
IgnoreContextualType::create(*this, lhs, rhs, loc));
49224922
break;
49234923
}
49244924
}

0 commit comments

Comments
 (0)