Skip to content

Conversation

@daltonclaybrook
Copy link
Contributor

This PR fixes a documentation bug stating that the names: argument is required for @attached macros with the accessor role. In reality, this argument is not required for accessor macros.

Fixes: #374

@amartini51
Copy link
Member

amartini51 commented Jul 29, 2025

@daltonclaybrook Were you able to confirm that this is correct and expected behavior from Swift Syntax, as suggested on the GitHub issue? If not, do you know who to talk to, or can I help you find a technical reviewer? Thanks!

Marking this as a draft, pending tech review.

@amartini51 amartini51 marked this pull request as draft July 29, 2025 23:24
@amartini51 amartini51 changed the title Update Attributes.md to remove error regarding accessor macros Fix list of macro roles that need "names:" argument Jul 29, 2025
@hborla
Copy link
Member

hborla commented Aug 21, 2025

@daltonclaybrook is correct; attached accessor macros do not require a names argument. The names argument is only required if the accessor macro generates property observers. This behavior is covered by SE-0389 in the section on accessor macros here: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0389-attached-macros.md#accessor-macros

@amartini51 amartini51 marked this pull request as ready for review August 21, 2025 15:55
@amartini51 amartini51 self-assigned this Aug 21, 2025
@amartini51 amartini51 requested review from amartini51 and removed request for amartini51 August 22, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs state that accessor macros require the names: argument, but in reality they do not

3 participants