mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Move SingleValueStmtUsageChecker into pre-checking
These diagnostics are better suited for pre-checking since we ought to be emitting them even if there's some other error with the expression.
This commit is contained in:
@@ -6,6 +6,6 @@ let x = if .random() {
|
||||
then 0
|
||||
// expected-error@-1 {{cannot find 'then' in scope}}
|
||||
// expected-error@-2 {{consecutive statements on a line must be separated by ';'}}
|
||||
} else {
|
||||
} else { // expected-error {{non-expression branch of 'if' expression may only end with a 'throw'}}
|
||||
1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user