8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@attached(conformance) public macro demonstration() = #externalMacro(module: "WWDC23Macros", type: "DemostrationMacro") extension DemostrationMacro: ConformanceMacro { public static func expansion<Declaration, Context>( of node: AttributeSyntax, providingConformancesOf declaration: Declaration, in context: Context ) throws -> [(TypeSyntax, GenericWhereClauseSyntax?)] where Declaration : DeclGroupSyntax, Context : MacroExpansionContext { return [("DemonstrationProtocol", nil)] } @main struct WWDCHelperPlugin: CompilerPlugin { let providingMacros: [Macro.Type] = [ DemostrationMacro.self ] } // in Test file let testMacros: [String: Macro.Type] = [ "demonstration": DemostrationMacro.self, ] func testMacro() { assertMacroExpansion( """ @demonstration() class TestClass { } """, expandedSource: """ class TestClass { } extension TestClass : DemonstrationProtocol {} """, macros: testMacros ) }
There is an error when I run the test case:
error: -[WWDC23Tests.WWDC23Tests testMacro] : failed - Actual output (+) differed from expected output (-): class TestClass { } –extension TestClass : DemonstrationProtocol {}
But it runs fine when I execute it in the code.
It seems that the macro is missing the last line when it expands in the test.
No response
The text was updated successfully, but these errors were encountered:
Thanks for reporting. This is a duplicate of #1742 and has been fixed by #1742
Sorry, something went wrong.
conformingTo
No branches or pull requests
Description
There is an error when I run the test case:
But it runs fine when I execute it in the code.

It seems that the macro is missing the last line when it expands in the test.
Steps to Reproduce
No response
The text was updated successfully, but these errors were encountered: