mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSSimplify] Handle optional wrong type conversion
This commit is contained in:
@@ -2842,8 +2842,10 @@ bool ConstraintSystem::repairFailures(
|
|||||||
|
|
||||||
// If it has a deep equality restriction, defer the diagnostic to
|
// If it has a deep equality restriction, defer the diagnostic to
|
||||||
// GenericMismatch.
|
// GenericMismatch.
|
||||||
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality))
|
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality)) {
|
||||||
return false;
|
if (!lhs->getOptionalObjectType() && !rhs->getOptionalObjectType())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
auto *fix = ContextualMismatch::create(*this, lhs, rhs,
|
auto *fix = ContextualMismatch::create(*this, lhs, rhs,
|
||||||
getConstraintLocator(locator));
|
getConstraintLocator(locator));
|
||||||
|
|||||||
Reference in New Issue
Block a user