Skip to content

Commit b5ca122

Browse files
authored
Merge pull request swiftlang#63251 from ahoppen/ahoppen/only-base-nodes-expressible-by-string
[SwiftSyntax] Adjustments because `VariableDeclSyntax` etc. are no longer expressible by string literals
2 parents e2be2fe + d0f0652 commit b5ca122

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/Macros/Inputs/syntax_macro_definitions.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,13 @@ extension TypeWrapperMacro: MemberMacro {
313313
attachedTo decl: DeclSyntax,
314314
in context: inout MacroExpansionContext
315315
) throws -> [DeclSyntax] {
316-
let storageVariable: VariableDeclSyntax =
316+
let storageVariable: DeclSyntax =
317317
"""
318318
private var _storage = _Storage()
319319
"""
320320

321321
return [
322-
DeclSyntax(storageVariable),
322+
storageVariable,
323323
]
324324
}
325325
}
@@ -355,17 +355,17 @@ public struct AddMembers: MemberMacro {
355355
attachedTo decl: DeclSyntax,
356356
in context: inout MacroExpansionContext
357357
) throws -> [DeclSyntax] {
358-
let storageStruct: StructDeclSyntax =
358+
let storageStruct: DeclSyntax =
359359
"""
360360
struct Storage {}
361361
"""
362362

363-
let storageVariable: VariableDeclSyntax =
363+
let storageVariable: DeclSyntax =
364364
"""
365365
private var storage = Storage()
366366
"""
367367

368-
let instanceMethod: FunctionDeclSyntax =
368+
let instanceMethod: DeclSyntax =
369369
"""
370370
func getStorage() -> Storage {
371371
print("synthesized method")
@@ -374,9 +374,9 @@ public struct AddMembers: MemberMacro {
374374
"""
375375

376376
return [
377-
DeclSyntax(storageStruct),
378-
DeclSyntax(storageVariable),
379-
DeclSyntax(instanceMethod),
377+
storageStruct,
378+
storageVariable,
379+
instanceMethod,
380380
]
381381
}
382382
}

0 commit comments

Comments
 (0)