File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,9 @@ class BuilderClosureVisitor
288
288
unhandledNode = patternBinding;
289
289
return ;
290
290
}
291
+
292
+ // Also check for invalid attributes.
293
+ TypeChecker::checkDeclAttributes (var);
291
294
}
292
295
}
293
296
Original file line number Diff line number Diff line change @@ -43,3 +43,9 @@ dummy {
43
43
@Wrapper var wrappedVar : Int = 123 // expected-error {{closure containing a declaration cannot be used with result builder 'DummyBuilder'}}
44
44
( )
45
45
}
46
+
47
+ dummy {
48
+ @resultBuilder var attributedVar : Int = 123 // expected-error {{@resultBuilder' attribute cannot be applied to this declaration}}
49
+ // expected-warning@-1 {{variable 'attributedVar' was never used; consider replacing with '_' or removing it}}
50
+ ( )
51
+ }
You can’t perform that action at this time.
0 commit comments