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
When applying an accessor macro to e.g. a struct, assertMacroExpansion will currently happily swallow the attribute. It should, however, emit an error that accessor macros can’t be applied to structs. Ie. the following test case should emit an error.
func testAccessorOnStruct(){structTestMacro:AccessorMacro{staticfunc expansion(
of node:AttributeSyntax,
providingAccessorsOf declaration:someDeclSyntaxProtocol,
in context:someMacroExpansionContext)throws->[AccessorDeclSyntax]{return[]}}assertMacroExpansion("@Test struct Foo {}",
expandedSource:"struct Foo {}",
macros:["Test":TestMacro.self])}