@@ -105,7 +105,7 @@ extension ASTGenVisitor {
105
105
underlyingType: self . generate ( type: node. initializer. value) ,
106
106
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
107
107
)
108
- decl . asDecl . attrs = attrs . attributes
108
+ attrs. attach ( to : decl . asDecl )
109
109
return decl
110
110
}
111
111
@@ -129,7 +129,7 @@ extension ASTGenVisitor {
129
129
end: node. memberBlock. rightBrace
130
130
)
131
131
)
132
- decl . asDecl . attrs = attrs . attributes
132
+ attrs. attach ( to : decl . asDecl )
133
133
134
134
self . withDeclContext ( decl. asDeclContext) {
135
135
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) . lazy. bridgedArray ( in: self ) )
@@ -158,7 +158,7 @@ extension ASTGenVisitor {
158
158
end: node. memberBlock. rightBrace
159
159
)
160
160
)
161
- decl . asDecl . attrs = attrs . attributes
161
+ attrs. attach ( to : decl . asDecl )
162
162
163
163
self . withDeclContext ( decl. asDeclContext) {
164
164
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) . lazy. bridgedArray ( in: self ) )
@@ -188,7 +188,7 @@ extension ASTGenVisitor {
188
188
) ,
189
189
isActor: false
190
190
)
191
- decl . asDecl . attrs = attrs . attributes
191
+ attrs. attach ( to : decl . asDecl )
192
192
193
193
self . withDeclContext ( decl. asDeclContext) {
194
194
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) . lazy. bridgedArray ( in: self ) )
@@ -218,7 +218,7 @@ extension ASTGenVisitor {
218
218
) ,
219
219
isActor: true
220
220
)
221
- decl . asDecl . attrs = attrs . attributes
221
+ attrs. attach ( to : decl . asDecl )
222
222
223
223
self . withDeclContext ( decl. asDeclContext) {
224
224
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) . lazy. bridgedArray ( in: self ) )
@@ -250,7 +250,7 @@ extension ASTGenVisitor {
250
250
end: node. memberBlock. rightBrace
251
251
)
252
252
)
253
- decl . asDecl . attrs = attrs . attributes
253
+ attrs. attach ( to : decl . asDecl )
254
254
255
255
self . withDeclContext ( decl. asDeclContext) {
256
256
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) . lazy. bridgedArray ( in: self ) )
@@ -275,7 +275,7 @@ extension ASTGenVisitor {
275
275
defaultType: self . generate ( type: node. initializer? . value) ,
276
276
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
277
277
)
278
- decl . asDecl . attrs = attrs . attributes
278
+ attrs. attach ( to : decl . asDecl )
279
279
return decl
280
280
}
281
281
}
@@ -297,7 +297,7 @@ extension ASTGenVisitor {
297
297
end: node. memberBlock. rightBrace
298
298
)
299
299
)
300
- decl . asDecl . attrs = attrs . attributes
300
+ attrs. attach ( to : decl . asDecl )
301
301
302
302
self . withDeclContext ( decl. asDeclContext) {
303
303
decl. setParsedMembers ( self . generate ( memberBlockItemList: node. memberBlock. members) . lazy. bridgedArray ( in: self ) )
@@ -334,7 +334,7 @@ extension ASTGenVisitor {
334
334
guard let elemDecl = self . generate ( enumCaseElement: elem) else {
335
335
return nil
336
336
}
337
- elemDecl . asDecl . attrs = attrs . attributes
337
+ attrs. attach ( to : elemDecl . asDecl )
338
338
return elemDecl
339
339
} )
340
340
return . createParsed(
@@ -419,7 +419,8 @@ extension ASTGenVisitor {
419
419
throwsSpecifierLoc: self . generateSourceLoc ( node. effectSpecifiers? . throwsClause) ,
420
420
thrownType: self . generate ( type: node. effectSpecifiers? . thrownError)
421
421
)
422
- accessor. asDecl. setAttrs ( attrs)
422
+ // FIXME: Ought to use DeclAttributesResult.attach(to:)
423
+ accessor. asDecl. attrs = attrs
423
424
if let body = node. body {
424
425
self . withDeclContext ( accessor. asDeclContext) {
425
426
accessor. setParsedBody ( self . generate ( codeBlock: body) )
@@ -580,7 +581,7 @@ extension ASTGenVisitor {
580
581
arrowLoc: self . generateSourceLoc ( node. returnClause. arrow) ,
581
582
returnType: self . generate ( type: node. returnClause. type)
582
583
)
583
- subscriptDecl . asDecl . attrs = attrs . attributes
584
+ attrs. attach ( to : subscriptDecl . asDecl )
584
585
585
586
if let accessors = node. accessorBlock {
586
587
let storage = subscriptDecl. asAbstractStorageDecl
@@ -615,7 +616,7 @@ extension ASTGenVisitor {
615
616
returnType: self . generate ( type: node. signature. returnClause? . type) ,
616
617
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
617
618
)
618
- decl . asDecl . attrs = attrs . attributes
619
+ attrs. attach ( to : decl . asDecl )
619
620
620
621
if let body = node. body {
621
622
self . withDeclContext ( decl. asDeclContext) {
@@ -642,7 +643,7 @@ extension ASTGenVisitor {
642
643
thrownType: self . generate ( type: node. signature. effectSpecifiers? . thrownError) ,
643
644
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
644
645
)
645
- decl . asDecl . attrs = attrs . attributes
646
+ attrs. attach ( to : decl . asDecl )
646
647
647
648
if let body = node. body {
648
649
self . withDeclContext ( decl. asDeclContext) {
@@ -661,7 +662,7 @@ extension ASTGenVisitor {
661
662
declContext: self . declContext,
662
663
deinitKeywordLoc: self . generateSourceLoc ( node. deinitKeyword)
663
664
)
664
- decl . asDecl . attrs = attrs . attributes
665
+ attrs. attach ( to : decl . asDecl )
665
666
666
667
if let body = node. body {
667
668
self . withDeclContext ( decl. asDeclContext) {
@@ -691,7 +692,7 @@ extension ASTGenVisitor {
691
692
resultType: self . generate ( type: node. signature. returnClause? . type) ,
692
693
definition: self . generate ( expr: node. definition? . value)
693
694
)
694
- decl . asDecl . setAttrs ( attrs . attributes ) ;
695
+ attrs . attach ( to : decl . asDecl )
695
696
return decl;
696
697
}
697
698
}
@@ -870,7 +871,7 @@ extension ASTGenVisitor {
870
871
lowerThanNames: self . generate ( precedenceGroupNameList: body. lowerThanRelation? . precedenceGroups) ,
871
872
rightBraceLoc: self . generateSourceLoc ( node. rightBrace)
872
873
)
873
- decl . asDecl . attrs = attrs . attributes
874
+ attrs. attach ( to : decl . asDecl )
874
875
return decl
875
876
}
876
877
}
@@ -917,7 +918,7 @@ extension ASTGenVisitor {
917
918
self . generateLocatedIdentifier ( $0. name)
918
919
} . bridgedArray ( in: self )
919
920
)
920
- decl . asDecl . attrs = attrs . attributes
921
+ attrs. attach ( to : decl . asDecl )
921
922
return decl
922
923
}
923
924
}
0 commit comments