[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

@@ -560,6 +560,9 @@ func bad_if() {
if (x: false) {} // expected-error {{cannot convert value of type '(x: Bool)' to expected condition type 'Bool'}}
if (x: 1) {} // expected-error {{cannot convert value of type '(x: Int)' to expected condition type 'Bool'}}
if nil {} // expected-error {{'nil' is not compatible with expected condition type 'Bool'}}
if undefined {} // expected-error {{cannot find 'undefined' in scope}}
if [undefined] {} // expected-error {{cannot find 'undefined' in scope}}
// expected-error@-1 {{cannot convert value of type '[Element]' to expected condition type 'Bool'}}
}
// Typo correction for loop labels