@@ -313,13 +313,13 @@ extension TypeWrapperMacro: MemberMacro {
313
313
attachedTo decl: DeclSyntax ,
314
314
in context: inout MacroExpansionContext
315
315
) throws -> [ DeclSyntax ] {
316
- let storageVariable : VariableDeclSyntax =
316
+ let storageVariable : DeclSyntax =
317
317
"""
318
318
private var _storage = _Storage()
319
319
"""
320
320
321
321
return [
322
- DeclSyntax ( storageVariable) ,
322
+ storageVariable,
323
323
]
324
324
}
325
325
}
@@ -355,17 +355,17 @@ public struct AddMembers: MemberMacro {
355
355
attachedTo decl: DeclSyntax ,
356
356
in context: inout MacroExpansionContext
357
357
) throws -> [ DeclSyntax ] {
358
- let storageStruct : StructDeclSyntax =
358
+ let storageStruct : DeclSyntax =
359
359
"""
360
360
struct Storage {}
361
361
"""
362
362
363
- let storageVariable : VariableDeclSyntax =
363
+ let storageVariable : DeclSyntax =
364
364
"""
365
365
private var storage = Storage()
366
366
"""
367
367
368
- let instanceMethod : FunctionDeclSyntax =
368
+ let instanceMethod : DeclSyntax =
369
369
"""
370
370
func getStorage() -> Storage {
371
371
print( " synthesized method " )
@@ -374,9 +374,9 @@ public struct AddMembers: MemberMacro {
374
374
"""
375
375
376
376
return [
377
- DeclSyntax ( storageStruct) ,
378
- DeclSyntax ( storageVariable) ,
379
- DeclSyntax ( instanceMethod) ,
377
+ storageStruct,
378
+ storageVariable,
379
+ instanceMethod,
380
380
]
381
381
}
382
382
}
0 commit comments