[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:
Hamish Knight
2025-10-27 20:59:10 +00:00
parent 82f4a10971
commit 2c0ac69433
2 changed files with 16 additions and 1 deletions

View File

@@ -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