Relative Content

Tag Archive for swiftswift-macro

Swift Member Macro: Get Raw String Literal of Type Annotation

Context Consider this class, decorated with a macro: @Blah final class Foo { var title: String = “” var count: Int = 0 } In the implementation of the @Blah Macro, I want to inspect the TypeSyntax for each member property and compare it. Like this: static func expansion(of node: AttributeSyntax, providingMembersOf declaration: some DeclGroupSyntax, […]

Swift Member Macro: Get Raw String Literal of Type Annotation

Context Consider this class, decorated with a macro: @Blah final class Foo { var title: String = “” var count: Int = 0 } In the implementation of the @Blah Macro, I want to inspect the TypeSyntax for each member property and compare it. Like this: static func expansion(of node: AttributeSyntax, providingMembersOf declaration: some DeclGroupSyntax, […]

Swift Member Macro: Get Raw String Literal of Type Annotation

Context Consider this class, decorated with a macro: @Blah final class Foo { var title: String = “” var count: Int = 0 } In the implementation of the @Blah Macro, I want to inspect the TypeSyntax for each member property and compare it. Like this: static func expansion(of node: AttributeSyntax, providingMembersOf declaration: some DeclGroupSyntax, […]

Swift Member Macro: Get Raw String Literal of Type Annotation

Context Consider this class, decorated with a macro: @Blah final class Foo { var title: String = “” var count: Int = 0 } In the implementation of the @Blah Macro, I want to inspect the TypeSyntax for each member property and compare it. Like this: static func expansion(of node: AttributeSyntax, providingMembersOf declaration: some DeclGroupSyntax, […]

Swift Member Macro: Get Raw String Literal of Type Annotation

Context Consider this class, decorated with a macro: @Blah final class Foo { var title: String = “” var count: Int = 0 } In the implementation of the @Blah Macro, I want to inspect the TypeSyntax for each member property and compare it. Like this: static func expansion(of node: AttributeSyntax, providingMembersOf declaration: some DeclGroupSyntax, […]