Skip to content

[5.9][Macros] Disallow self and Self as macro names #64804

New issue

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

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 31, 2023

Cherry-pick #64609 to release/5.9.


We were allowing self and Self as freestanding macro names, which we don’t want. We should ban this before introducing macros as a new feature and it starts to become legacy we will carry around forever.

Change parseDeclNameRef so that you need to explicitly request parsing of self or Self as the declaration’s base name, and adjust all call sites except those for macros to pass that flag.

We were allowing `self` and `Self` as freestanding macro names, which we don’t want.
@ahoppen ahoppen requested a review from a team as a code owner March 31, 2023 04:30
@ahoppen
Copy link
Member Author

ahoppen commented Mar 31, 2023

@swift-ci Please test

@ahoppen ahoppen merged commit 5d64c8b into swiftlang:release/5.9 Mar 31, 2023
@ahoppen ahoppen deleted the ahoppen/5.9/no-self-macro branch March 31, 2023 15:12
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants