You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Conformance macros used in the input source are discarded without expansion. A basic example:
structConformance:ConformanceMacro{publicstaticfunc expansion(
of node:AttributeSyntax,
providingConformancesOf declaration:someDeclGroupSyntax,
in context:someMacroExpansionContext)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
The text was updated successfully, but these errors were encountered:
Somehow, we forgot to implement this here, even though the compiler has
supported it for a long time.
Fixesswiftlang#1742 / rdar://110418242.
(cherry picked from commit 318d6c7)
Description
Conformance macros used in the input source are discarded without expansion. A basic example:
This test passes despite the implementation being
fatalError()
due toexpansion(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
The text was updated successfully, but these errors were encountered: