mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CS] Add conversion for ErrorExpr's original expr
Make sure we don't produce unnecessary diagnostics while still allowing things like cursor info to work. No test change since it's covered by the next commit.
This commit is contained in:
@@ -5582,6 +5582,10 @@ bool ConstraintSystem::repairFailures(
|
||||
if (!anchor)
|
||||
return false;
|
||||
|
||||
// If we have an ErrorExpr anchor, we don't need to do any more fixes.
|
||||
if (isExpr<ErrorExpr>(anchor))
|
||||
return true;
|
||||
|
||||
// This could be:
|
||||
// - `InOutExpr` used with r-value e.g. `foo(&x)` where `x` is a `let`.
|
||||
// - `ForceValueExpr` e.g. `foo.bar! = 42` where `bar` or `foo` are
|
||||
|
||||
Reference in New Issue
Block a user