Skip to content

Commit 8b49e35

Browse files
committed
[ResultBuilders] NFC: Adjust error diagnostic about use of explicit 'return' statement(s)
1 parent d912e12 commit 8b49e35

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5461,8 +5461,8 @@ NOTE(previous_result_builder_here, none,
54615461
ERROR(result_builder_arguments, none,
54625462
"result builder attributes cannot have arguments", ())
54635463
ERROR(result_builder_disabled_by_return, none,
5464-
"application of result builder %0 disabled by explicit 'return' "
5465-
"statement", (Type))
5464+
"cannot use explicit 'return' statement in the body of result builder %0",
5465+
(Type))
54665466
WARNING(result_builder_disabled_by_return_warn, none,
54675467
"application of result builder %0 disabled by explicit 'return' "
54685468
"statement", (Type))

test/Constraints/result_builder_diags.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func test_invalid_return_type_in_body() {
290290
tuplify(true) { _ -> (Void, Int) in
291291
tuplify(false) { condition in
292292
if condition {
293-
return 42 // expected-error {{application of result builder 'TupleBuilder' disabled by explicit 'return' statement}}
293+
return 42 // expected-error {{cannot use explicit 'return' statement in the body of result builder 'TupleBuilder'}}
294294
// expected-note@-1 {{remove 'return' statements to apply the result builder}} {{9-16=}}
295295
} else {
296296
1

0 commit comments

Comments
 (0)