Skip to content

Conversation

@TTOzzi
Copy link
Member

@TTOzzi TTOzzi commented Nov 27, 2025

Resolve #1102

Fix UseSingleLinePropertyGetter so that explicit getters are left untouched when they carry attributes (e.g. @_lifetime).
Since it’s not clear how to reliably distinguish between attributes that can appear at the property level and those that are accessor-only, it seems safer to avoid collapsing getters whenever attributes are present 🤔

Copy link
Member

@allevato allevato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is the right choice. Having any attributes on the accessor itself is a statement of intent, so we should respect that. (Most attributes that go on accessors are specific to that accessor function anyway, just like how async throws goes there.)

@bnbarham
Copy link
Contributor

bnbarham commented Dec 1, 2025

Thanks @TTOzzi!

@bnbarham bnbarham merged commit a75a017 into swiftlang:main Dec 1, 2025
55 of 58 checks passed
@ahoppen
Copy link
Member

ahoppen commented Dec 1, 2025

Thanks for the quick fix @TTOzzi 🙏🏽

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.

Formatting removes @_lifetime attributes from accessor

4 participants