[Diagnostics] s/may/must/ in 'may not fall through'

This commit is contained in:
Graydon Hoare
2017-09-28 23:30:31 -04:00
parent 3c8c880b8e
commit 324471a2bc
2 changed files with 2 additions and 2 deletions

View File

@@ -221,7 +221,7 @@ ERROR(missing_never_call,none,
"call to another never-returning function on all paths", "call to another never-returning function on all paths",
(Type, unsigned)) (Type, unsigned))
ERROR(guard_body_must_not_fallthrough,none, 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", ()) " to exit the scope", ())
WARNING(unreachable_code,none, "will never be executed", ()) WARNING(unreachable_code,none, "will never be executed", ())
NOTE(unreachable_code_branch,none, NOTE(unreachable_code_branch,none,

View File

@@ -218,7 +218,7 @@ class r20097963MyClass {
func die() -> Never { die() } func die() -> Never { die() }
func testGuard(_ a : Int) { 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 { return } // ok
guard case 4 = a else { die() } // ok guard case 4 = a else { die() } // ok