Skip to content

Commit 6c92f3f

Browse files
authored
[Diag]: Result builder misplacement error message mentions subscript
1 parent c15ed6e commit 6c92f3f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7263,7 +7263,7 @@ NOTE(note_result_builder_control_flow, none,
72637263
"builder %0", (DeclName))
72647264
ERROR(result_builder_attribute_not_allowed_here, none,
72657265
"result builder attribute %0 can only be applied to a parameter, "
7266-
"function, or computed property", (Identifier))
7266+
"function, subscript, or computed property", (Identifier))
72677267
ERROR(result_builder_attribute_on_storage_without_getter, none,
72687268
"result builder attribute %0 can only be applied to a "
72697269
"%select{subscript|property|constant|variable}1 if it defines a getter",

test/decl/var/result_builders.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct Maker {} // expected-error {{result builder must provide at least one sta
1212
@resultBuilder
1313
class Inventor {} // expected-error {{result builder must provide at least one static 'buildBlock' method}}
1414

15-
@Maker // expected-error {{result builder attribute 'Maker' can only be applied to a parameter, function, or computed property}}
15+
@Maker // expected-error {{result builder attribute 'Maker' can only be applied to a parameter, function, subscript, or computed property}}
1616
typealias typename = Inventor
1717

1818
@Maker // expected-error {{result builder attribute 'Maker' can only be applied to a variable if it defines a getter}}

0 commit comments

Comments
 (0)