@@ -96,7 +96,7 @@ extension ASTGenVisitor {
96
96
underlyingType: self . generate ( type: node. initializer. value) ,
97
97
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
98
98
)
99
- decl . asDecl . attrs = attrs . attributes
99
+ attrs. attach ( to : decl . asDecl )
100
100
return decl
101
101
}
102
102
@@ -118,7 +118,7 @@ extension ASTGenVisitor {
118
118
end: node. memberBlock. rightBrace
119
119
)
120
120
)
121
- decl . asDecl . attrs = attrs . attributes
121
+ attrs. attach ( to : decl . asDecl )
122
122
123
123
self . withDeclContext ( decl. asDeclContext) {
124
124
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -145,7 +145,7 @@ extension ASTGenVisitor {
145
145
end: node. memberBlock. rightBrace
146
146
)
147
147
)
148
- decl . asDecl . attrs = attrs . attributes
148
+ attrs. attach ( to : decl . asDecl )
149
149
150
150
self . withDeclContext ( decl. asDeclContext) {
151
151
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -173,7 +173,7 @@ extension ASTGenVisitor {
173
173
) ,
174
174
isActor: false
175
175
)
176
- decl . asDecl . attrs = attrs . attributes
176
+ attrs. attach ( to : decl . asDecl )
177
177
178
178
self . withDeclContext ( decl. asDeclContext) {
179
179
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -201,7 +201,7 @@ extension ASTGenVisitor {
201
201
) ,
202
202
isActor: true
203
203
)
204
- decl . asDecl . attrs = attrs . attributes
204
+ attrs. attach ( to : decl . asDecl )
205
205
206
206
self . withDeclContext ( decl. asDeclContext) {
207
207
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -231,7 +231,7 @@ extension ASTGenVisitor {
231
231
end: node. memberBlock. rightBrace
232
232
)
233
233
)
234
- decl . asDecl . attrs = attrs . attributes
234
+ attrs. attach ( to : decl . asDecl )
235
235
236
236
self . withDeclContext ( decl. asDeclContext) {
237
237
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -254,7 +254,7 @@ extension ASTGenVisitor {
254
254
defaultType: self . generate ( type: node. initializer? . value) ,
255
255
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
256
256
)
257
- decl . asDecl . attrs = attrs . attributes
257
+ attrs. attach ( to : decl . asDecl )
258
258
return decl
259
259
}
260
260
}
@@ -276,7 +276,7 @@ extension ASTGenVisitor {
276
276
end: node. memberBlock. rightBrace
277
277
)
278
278
)
279
- decl . asDecl . attrs = attrs . attributes
279
+ attrs. attach ( to : decl . asDecl )
280
280
281
281
self . withDeclContext ( decl. asDeclContext) {
282
282
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) )
@@ -309,7 +309,7 @@ extension ASTGenVisitor {
309
309
// All attributes goes to each element.
310
310
let elements = node. elements. lazy. map ( { elem -> BridgedEnumElementDecl in
311
311
let elemDecl = self . generate ( enumCaseElement: elem)
312
- elemDecl . asDecl . attrs = attrs . attributes
312
+ attrs. attach ( to : elemDecl . asDecl )
313
313
return elemDecl
314
314
} )
315
315
return . createParsed(
@@ -536,7 +536,7 @@ extension ASTGenVisitor {
536
536
arrowLoc: self . generateSourceLoc ( node. returnClause. arrow) ,
537
537
returnType: self . generate ( type: node. returnClause. type)
538
538
)
539
- subscriptDecl . asDecl . attrs = attrs . attributes
539
+ attrs. attach ( to : subscriptDecl . asDecl )
540
540
541
541
if let accessors = node. accessorBlock {
542
542
let storage = subscriptDecl. asAbstractStorageDecl
@@ -570,7 +570,7 @@ extension ASTGenVisitor {
570
570
returnType: self . generate ( type: node. signature. returnClause? . type) ,
571
571
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
572
572
)
573
- decl . asDecl . attrs = attrs . attributes
573
+ attrs. attach ( to : decl . asDecl )
574
574
575
575
if let body = node. body {
576
576
self . withDeclContext ( decl. asDeclContext) {
@@ -597,7 +597,7 @@ extension ASTGenVisitor {
597
597
thrownType: self . generate ( type: node. signature. effectSpecifiers? . thrownError) ,
598
598
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
599
599
)
600
- decl . asDecl . attrs = attrs . attributes
600
+ attrs. attach ( to : decl . asDecl )
601
601
602
602
if let body = node. body {
603
603
self . withDeclContext ( decl. asDeclContext) {
@@ -616,7 +616,7 @@ extension ASTGenVisitor {
616
616
declContext: self . declContext,
617
617
deinitKeywordLoc: self . generateSourceLoc ( node. deinitKeyword)
618
618
)
619
- decl . asDecl . attrs = attrs . attributes
619
+ attrs. attach ( to : decl . asDecl )
620
620
621
621
if let body = node. body {
622
622
self . withDeclContext ( decl. asDeclContext) {
@@ -783,7 +783,7 @@ extension ASTGenVisitor {
783
783
lowerThanNames: self . generate ( precedenceGroupNameList: body. lowerThanRelation? . precedenceGroups) ,
784
784
rightBraceLoc: self . generateSourceLoc ( node. rightBrace)
785
785
)
786
- decl . asDecl . attrs = attrs . attributes
786
+ attrs. attach ( to : decl . asDecl )
787
787
return decl
788
788
}
789
789
}
@@ -830,7 +830,7 @@ extension ASTGenVisitor {
830
830
self . generateLocatedIdentifier ( $0. name)
831
831
} . bridgedArray ( in: self )
832
832
)
833
- decl . asDecl . attrs = attrs . attributes
833
+ attrs. attach ( to : decl . asDecl )
834
834
return decl
835
835
}
836
836
}
0 commit comments