mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Diagnostics] s/may/must/ in 'may not fall through'
This commit is contained in:
@@ -221,7 +221,7 @@ ERROR(missing_never_call,none,
|
||||
"call to another never-returning function on all paths",
|
||||
(Type, unsigned))
|
||||
ERROR(guard_body_must_not_fallthrough,none,
|
||||
"'guard' body may not fall through, consider using a 'return' or 'throw'"
|
||||
"'guard' body must not fall through, consider using a 'return' or 'throw'"
|
||||
" to exit the scope", ())
|
||||
WARNING(unreachable_code,none, "will never be executed", ())
|
||||
NOTE(unreachable_code_branch,none,
|
||||
|
||||
@@ -218,7 +218,7 @@ class r20097963MyClass {
|
||||
func die() -> Never { die() }
|
||||
|
||||
func testGuard(_ a : Int) {
|
||||
guard case 4 = a else { } // expected-error {{'guard' body may not fall through, consider using a 'return' or 'throw'}}
|
||||
guard case 4 = a else { } // expected-error {{'guard' body must not fall through, consider using a 'return' or 'throw'}}
|
||||
|
||||
guard case 4 = a else { return } // ok
|
||||
guard case 4 = a else { die() } // ok
|
||||
|
||||
Reference in New Issue
Block a user