mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Diagnostic] Don't fix partial mismatch for sub-types associated with optional conversion
If mismatch detected by `repairFailures` is related to a complex wrapped value of optional type formed from optional-to-optional or value-to-optional conversion let's not try to fix it directly but let `simplifyRestrictedConstraintImpl` record a top-level fix for more context. Resolves: rdar://problem/59703585
This commit is contained in:
@@ -1884,6 +1884,12 @@ bool ContextualFailure::diagnoseAsError() {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isa<AssignExpr>(anchor)) {
|
||||
emitDiagnostic(anchor->getLoc(), diag::cannot_convert_assign,
|
||||
getFromType(), getToType());
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user