Skip to content

Commit 0e1a03d

Browse files
[CSSimplify] Handle optional wrong type conversion
1 parent 06201a6 commit 0e1a03d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,8 +2842,10 @@ bool ConstraintSystem::repairFailures(
28422842

28432843
// If it has a deep equality restriction, defer the diagnostic to
28442844
// GenericMismatch.
2845-
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality))
2846-
return false;
2845+
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality)) {
2846+
if (!lhs->getOptionalObjectType() && !rhs->getOptionalObjectType())
2847+
return false;
2848+
}
28472849

28482850
auto *fix = ContextualMismatch::create(*this, lhs, rhs,
28492851
getConstraintLocator(locator));

0 commit comments

Comments
 (0)