You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structGenericMaker<T>{} // expected-note {{generic type 'GenericMaker' declared here}}
69
+
structGenericMaker<T>{} // expected-note {{generic type 'GenericMaker' declared here}} expected-error {{function builder must provide at least one static 'buildBlock' method}}
70
70
71
71
structGenericContainer<T>{ // expected-note {{generic type 'GenericContainer' declared here}}
72
72
@_functionBuilder
73
-
structMaker{}
73
+
structMaker{} // expected-error {{function builder must provide at least one static 'buildBlock' method}}
74
74
}
75
75
76
76
func makeParamUnbound(@GenericMaker // expected-error {{reference to generic type 'GenericMaker' requires arguments}}
structInvalidBuilder1{} // expected-error {{function builder must provide at least one static 'buildBlock' method}}
137
+
138
+
@_functionBuilder
139
+
structInvalidBuilder2{ // expected-error {{function builder must provide at least one static 'buildBlock' method}}
140
+
func buildBlock(_ exprs:Any...)->Int{return exprs.count } // expected-note {{did you mean to make instance method 'buildBlock' static?}} {{3-3=static }}
141
+
}
142
+
143
+
@_functionBuilder
144
+
structInvalidBuilder3{ // expected-error {{function builder must provide at least one static 'buildBlock' method}}
145
+
varbuildBlock:(Any...)->Int={return $0.count } // expected-note {{potential match 'buildBlock' is not a static method}}
146
+
}
147
+
148
+
@_functionBuilder
149
+
structInvalidBuilder4{} // expected-error {{function builder must provide at least one static 'buildBlock' method}}
150
+
extensionInvalidBuilder4{
151
+
func buildBlock(_ exprs:Any...)->Int{return exprs.count } // expected-note {{did you mean to make instance method 'buildBlock' static?}} {{3-3=static }}
152
+
}
153
+
154
+
protocolInvalidBuilderHelper{}
155
+
extensionInvalidBuilderHelper{
156
+
func buildBlock(_ exprs:Any...)->Int{return exprs.count } // expected-note {{potential match 'buildBlock' is not a static method}}
157
+
}
158
+
159
+
@_functionBuilder
160
+
structInvalidBuilder5:InvalidBuilderHelper{} // expected-error {{function builder must provide at least one static 'buildBlock' method}}
161
+
162
+
@_functionBuilder
163
+
structInvalidBuilder6{ // expected-error {{function builder must provide at least one static 'buildBlock' method}}
164
+
staticvarbuildBlock:Int=0 // expected-note {{potential match 'buildBlock' is not a static method}}
structInvalidBuilder7{ // expected-error {{function builder must provide at least one static 'buildBlock' method}}
173
+
staticvarbuildBlock=Callable() // expected-note {{potential match 'buildBlock' is not a static method}}
174
+
}
175
+
176
+
classBuilderVarBase{
177
+
staticvarbuildBlock:(Any...)->Int={return $0.count } // expected-note {{potential match 'buildBlock' is not a static method}}
178
+
}
179
+
180
+
@_functionBuilder
181
+
classInvalidBuilder8:BuilderVarBase{} // expected-error {{function builder must provide at least one static 'buildBlock' method}}
182
+
183
+
protocolBuilderVarHelper{}
184
+
185
+
extensionBuilderVarHelper{
186
+
staticvarbuildBlock:(Any...)->Int{{return $0.count }} // expected-note {{potential match 'buildBlock' is not a static method}}
187
+
}
188
+
189
+
@_functionBuilder
190
+
structInvalidBuilder9:BuilderVarHelper{} // expected-error {{function builder must provide at least one static 'buildBlock' method}}
191
+
192
+
@_functionBuilder
193
+
structInvalidBuilder10{ // expected-error {{function builder must provide at least one static 'buildBlock' method}}
194
+
staticvarbuildBlock:(Any...)->Int={return $0.count } // expected-note {{potential match 'buildBlock' is not a static method}}
195
+
}
196
+
197
+
@_functionBuilder
198
+
enumInvalidBuilder11{ // expected-error {{function builder must provide at least one static 'buildBlock' method}}
199
+
case buildBlock(Any) // expected-note {{enum case 'buildBlock' cannot be used to satisfy the function builder requirement}}
200
+
}
201
+
202
+
structS{
203
+
@ValidBuilder1varv1:Int{1}
204
+
@ValidBuilder2varv2:Int{1}
205
+
@ValidBuilder3varv3:Int{1}
206
+
@ValidBuilder4varv4:Int{1}
207
+
@ValidBuilder5func v5()->Int{}
208
+
@InvalidBuilder1vari1:Int{1} // expected-error {{type 'InvalidBuilder1' has no member 'buildBlock'}}
209
+
@InvalidBuilder2vari2:Int{1} // expected-error {{instance member 'buildBlock' cannot be used on type 'InvalidBuilder2'; did you mean to use a value of this type instead?}}
210
+
@InvalidBuilder3vari3:Int{1} // expected-error {{instance member 'buildBlock' cannot be used on type 'InvalidBuilder3'; did you mean to use a value of this type instead?}}
211
+
@InvalidBuilder4vari4:Int{1} // expected-error {{instance member 'buildBlock' cannot be used on type 'InvalidBuilder4'; did you mean to use a value of this type instead?}}
212
+
@InvalidBuilder5vari5:Int{1} // expected-error {{instance member 'buildBlock' cannot be used on type 'InvalidBuilder5'; did you mean to use a value of this type instead?}}
213
+
@InvalidBuilder6vari6:Int{1} // expected-error {{cannot call value of non-function type 'Int'}}
0 commit comments