mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user