-
Notifications
You must be signed in to change notification settings - Fork 447
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Conformance macros used in the input source are discarded without expansion. A basic example:
struct Conformance: ConformanceMacro {
public static func expansion(
of node: AttributeSyntax,
providingConformancesOf declaration: some DeclGroupSyntax,
in context: some MacroExpansionContext
) throws -> [(TypeSyntax, GenericWhereClauseSyntax?)] {
fatalError()
}
}
assertMacroExpansion("@Foo class Bar {}", expandedSource: "class Bar {\n}",
macros: ["Foo": Conformance.self])
This test passes despite the implementation being fatalError()
due to expansion(of:performanceConformanceOf:in:)
never being called. There appears to be two parallel implementations of macro expansion with ConformanceMacro only being supported in expandAttachedMacro(), which is not called by SyntaxProtocol.expand().
There may be other macro types not implemented as well; I did not try them all.
Steps to Reproduce
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working