Skip to content

Commit 150203c

Browse files
committed
[Diagnostics] Use IgnoreContextualType for contextual failures related to closure body/result types
1 parent e512473 commit 150203c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4565,12 +4565,12 @@ bool ConstraintSystem::repairFailures(
45654565
return true;
45664566

45674567
// If we could record a generic arguments mismatch instead of this fix,
4568-
// don't record a ContextualMismatch here.
4568+
// don't record a contextual type mismatch here.
45694569
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality))
45704570
break;
45714571

4572-
auto *fix = ContextualMismatch::create(*this, lhs, rhs,
4573-
getConstraintLocator(locator));
4572+
auto *fix = IgnoreContextualType::create(*this, lhs, rhs,
4573+
getConstraintLocator(locator));
45744574
conversionsOrFixes.push_back(fix);
45754575
break;
45764576
}

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3885,7 +3885,7 @@ static bool diagnoseContextualFunctionCallGenericAmbiguity(
38853885
if (fixLocator->isForContextualType())
38863886
return true;
38873887

3888-
if (!(fix.second->getKind() == FixKind::ContextualMismatch ||
3888+
if (!(fix.second->getKind() == FixKind::IgnoreContextualType ||
38893889
fix.second->getKind() == FixKind::AllowTupleTypeMismatch))
38903890
return false;
38913891

0 commit comments

Comments
 (0)