@@ -92,7 +92,7 @@ extension ASTGenVisitor {
92
92
underlyingType: self . generate ( type: node. initializer. value) ,
93
93
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
94
94
)
95
- decl . asDecl . attrs = attrs . attributes
95
+ attrs. attach ( to : decl . asDecl )
96
96
return decl
97
97
}
98
98
@@ -114,7 +114,7 @@ extension ASTGenVisitor {
114
114
end: node. memberBlock. rightBrace
115
115
)
116
116
)
117
- decl . asDecl . attrs = attrs . attributes
117
+ attrs. attach ( to : decl . asDecl )
118
118
119
119
self . withDeclContext ( decl. asDeclContext) {
120
120
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -141,7 +141,7 @@ extension ASTGenVisitor {
141
141
end: node. memberBlock. rightBrace
142
142
)
143
143
)
144
- decl . asDecl . attrs = attrs . attributes
144
+ attrs. attach ( to : decl . asDecl )
145
145
146
146
self . withDeclContext ( decl. asDeclContext) {
147
147
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -169,7 +169,7 @@ extension ASTGenVisitor {
169
169
) ,
170
170
isActor: false
171
171
)
172
- decl . asDecl . attrs = attrs . attributes
172
+ attrs. attach ( to : decl . asDecl )
173
173
174
174
self . withDeclContext ( decl. asDeclContext) {
175
175
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -197,7 +197,7 @@ extension ASTGenVisitor {
197
197
) ,
198
198
isActor: true
199
199
)
200
- decl . asDecl . attrs = attrs . attributes
200
+ attrs. attach ( to : decl . asDecl )
201
201
202
202
self . withDeclContext ( decl. asDeclContext) {
203
203
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -227,7 +227,7 @@ extension ASTGenVisitor {
227
227
end: node. memberBlock. rightBrace
228
228
)
229
229
)
230
- decl . asDecl . attrs = attrs . attributes
230
+ attrs. attach ( to : decl . asDecl )
231
231
232
232
self . withDeclContext ( decl. asDeclContext) {
233
233
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -250,7 +250,7 @@ extension ASTGenVisitor {
250
250
defaultType: self . generate ( type: node. initializer? . value) ,
251
251
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
252
252
)
253
- decl . asDecl . attrs = attrs . attributes
253
+ attrs. attach ( to : decl . asDecl )
254
254
return decl
255
255
}
256
256
}
@@ -272,7 +272,7 @@ extension ASTGenVisitor {
272
272
end: node. memberBlock. rightBrace
273
273
)
274
274
)
275
- decl . asDecl . attrs = attrs . attributes
275
+ attrs. attach ( to : decl . asDecl )
276
276
277
277
self . withDeclContext ( decl. asDeclContext) {
278
278
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -305,7 +305,7 @@ extension ASTGenVisitor {
305
305
// All attributes goes to each element.
306
306
let elements = node. elements. lazy. map ( { elem -> BridgedEnumElementDecl in
307
307
let elemDecl = self . generate ( enumCaseElement: elem)
308
- elemDecl . asDecl . attrs = attrs . attributes
308
+ attrs. attach ( to : elemDecl . asDecl )
309
309
return elemDecl
310
310
} )
311
311
return . createParsed(
@@ -528,7 +528,7 @@ extension ASTGenVisitor {
528
528
arrowLoc: self . generateSourceLoc ( node. returnClause. arrow) ,
529
529
returnType: self . generate ( type: node. returnClause. type)
530
530
)
531
- subscriptDecl . asDecl . attrs = attrs . attributes
531
+ attrs. attach ( to : subscriptDecl . asDecl )
532
532
533
533
if let accessors = node. accessorBlock {
534
534
let storage = subscriptDecl. asAbstractStorageDecl
@@ -562,7 +562,7 @@ extension ASTGenVisitor {
562
562
returnType: self . generate ( type: node. signature. returnClause? . type) ,
563
563
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
564
564
)
565
- decl . asDecl . attrs = attrs . attributes
565
+ attrs. attach ( to : decl . asDecl )
566
566
567
567
if let body = node. body {
568
568
self . withDeclContext ( decl. asDeclContext) {
@@ -589,7 +589,7 @@ extension ASTGenVisitor {
589
589
thrownType: self . generate ( type: node. signature. effectSpecifiers? . thrownError) ,
590
590
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
591
591
)
592
- decl . asDecl . attrs = attrs . attributes
592
+ attrs. attach ( to : decl . asDecl )
593
593
594
594
if let body = node. body {
595
595
self . withDeclContext ( decl. asDeclContext) {
@@ -608,7 +608,7 @@ extension ASTGenVisitor {
608
608
declContext: self . declContext,
609
609
deinitKeywordLoc: self . generateSourceLoc ( node. deinitKeyword)
610
610
)
611
- decl . asDecl . attrs = attrs . attributes
611
+ attrs. attach ( to : decl . asDecl )
612
612
613
613
if let body = node. body {
614
614
self . withDeclContext ( decl. asDeclContext) {
@@ -771,7 +771,7 @@ extension ASTGenVisitor {
771
771
lowerThanNames: self . generate ( precedenceGroupNameList: body. lowerThanRelation? . precedenceGroups) ,
772
772
rightBraceLoc: self . generateSourceLoc ( node. rightBrace)
773
773
)
774
- decl . asDecl . attrs = attrs . attributes
774
+ attrs. attach ( to : decl . asDecl )
775
775
return decl
776
776
}
777
777
}
@@ -818,7 +818,7 @@ extension ASTGenVisitor {
818
818
self . generateLocatedIdentifier ( $0. name)
819
819
} . bridgedArray ( in: self )
820
820
)
821
- decl . asDecl . attrs = attrs . attributes
821
+ attrs. attach ( to : decl . asDecl )
822
822
return decl
823
823
}
824
824
}
0 commit comments