[CS] Eagerly bind hole in recordInvalidNode

We know this is where the issue is so we can immediately bind to a hole,
ensuring we don't produce unnecessary downstream diagnostics from
things we can't infer.
This commit is contained in:
Hamish Knight
2025-10-27 20:59:10 +00:00
parent c853d81d37
commit 61a5ae8e01
13 changed files with 33 additions and 20 deletions

View File

@@ -6694,6 +6694,10 @@ bool ConstraintSystem::repairFailures(
}
case ConstraintLocator::Condition: {
// If the condition is already a hole, we're done.
if (lhs->isPlaceholder())
return true;
if (repairViaOptionalUnwrap(*this, lhs, rhs, matchKind, conversionsOrFixes,
locator))
return true;