mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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
|
||||
// GenericMismatch.
|
||||
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality))
|
||||
return false;
|
||||
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality)) {
|
||||
if (!lhs->getOptionalObjectType() && !rhs->getOptionalObjectType())
|
||||
return false;
|
||||
}
|
||||
|
||||
auto *fix = ContextualMismatch::create(*this, lhs, rhs,
|
||||
getConstraintLocator(locator));
|
||||
|
||||
Reference in New Issue
Block a user