@@ -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(
@@ -403,7 +403,8 @@ extension ASTGenVisitor {
403
403
throwsSpecifierLoc: self . generateSourceLoc ( node. effectSpecifiers? . throwsClause) ,
404
404
thrownType: self . generate ( type: node. effectSpecifiers? . thrownError)
405
405
)
406
- accessor. asDecl. setAttrs ( attrs)
406
+ // FIXME: Ought to use DeclAttributesResult.attach(to:)
407
+ accessor. asDecl. attrs = attrs
407
408
if let body = node. body {
408
409
self . withDeclContext ( accessor. asDeclContext) {
409
410
accessor. setParsedBody ( self . generate ( codeBlock: body) )
@@ -564,7 +565,7 @@ extension ASTGenVisitor {
564
565
arrowLoc: self . generateSourceLoc ( node. returnClause. arrow) ,
565
566
returnType: self . generate ( type: node. returnClause. type)
566
567
)
567
- subscriptDecl . asDecl . attrs = attrs . attributes
568
+ attrs. attach ( to : subscriptDecl . asDecl )
568
569
569
570
if let accessors = node. accessorBlock {
570
571
let storage = subscriptDecl. asAbstractStorageDecl
@@ -599,7 +600,7 @@ extension ASTGenVisitor {
599
600
returnType: self . generate ( type: node. signature. returnClause? . type) ,
600
601
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
601
602
)
602
- decl . asDecl . attrs = attrs . attributes
603
+ attrs. attach ( to : decl . asDecl )
603
604
604
605
if let body = node. body {
605
606
self . withDeclContext ( decl. asDeclContext) {
@@ -626,7 +627,7 @@ extension ASTGenVisitor {
626
627
thrownType: self . generate ( type: node. signature. effectSpecifiers? . thrownError) ,
627
628
genericWhereClause: self . generate ( genericWhereClause: node. genericWhereClause)
628
629
)
629
- decl . asDecl . attrs = attrs . attributes
630
+ attrs. attach ( to : decl . asDecl )
630
631
631
632
if let body = node. body {
632
633
self . withDeclContext ( decl. asDeclContext) {
@@ -645,7 +646,7 @@ extension ASTGenVisitor {
645
646
declContext: self . declContext,
646
647
deinitKeywordLoc: self . generateSourceLoc ( node. deinitKeyword)
647
648
)
648
- decl . asDecl . attrs = attrs . attributes
649
+ attrs. attach ( to : decl . asDecl )
649
650
650
651
if let body = node. body {
651
652
self . withDeclContext ( decl. asDeclContext) {
@@ -675,7 +676,7 @@ extension ASTGenVisitor {
675
676
resultType: self . generate ( type: node. signature. returnClause? . type) ,
676
677
definition: self . generate ( expr: node. definition? . value)
677
678
)
678
- decl . asDecl . setAttrs ( attrs . attributes ) ;
679
+ attrs . attach ( to : decl . asDecl )
679
680
return decl;
680
681
}
681
682
}
@@ -854,7 +855,7 @@ extension ASTGenVisitor {
854
855
lowerThanNames: self . generate ( precedenceGroupNameList: body. lowerThanRelation? . precedenceGroups) ,
855
856
rightBraceLoc: self . generateSourceLoc ( node. rightBrace)
856
857
)
857
- decl . asDecl . attrs = attrs . attributes
858
+ attrs. attach ( to : decl . asDecl )
858
859
return decl
859
860
}
860
861
}
@@ -901,7 +902,7 @@ extension ASTGenVisitor {
901
902
self . generateLocatedIdentifier ( $0. name)
902
903
} . bridgedArray ( in: self )
903
904
)
904
- decl . asDecl . attrs = attrs . attributes
905
+ attrs. attach ( to : decl . asDecl )
905
906
return decl
906
907
}
907
908
}
0 commit comments