Skip to content

[Macros] Support module-qualified attached macro lookup #69457

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 6 commits into from
Dec 8, 2023

Conversation

ApolloZhu
Copy link
Contributor

@ApolloZhu ApolloZhu commented Oct 27, 2023

Allow attached macro expansion syntax to have a module qualifier, @Foo.Bar.

Resolves #65485 / rdar://108621205

@ApolloZhu
Copy link
Contributor Author

Rebased from and replaces #65863

@ApolloZhu
Copy link
Contributor Author

@swift-ci please smoke test

@ApolloZhu ApolloZhu force-pushed the qualified-macro-108621205 branch from 296ebb5 to e360aba Compare November 17, 2023 00:57
@ApolloZhu ApolloZhu requested a review from DougGregor November 28, 2023 23:02
@ApolloZhu
Copy link
Contributor Author

@swift-ci please smoke test

@ApolloZhu ApolloZhu force-pushed the qualified-macro-108621205 branch from e360aba to 51a5fc9 Compare November 30, 2023 02:09
@ApolloZhu
Copy link
Contributor Author

@swift-ci please smoke test

@ApolloZhu ApolloZhu force-pushed the qualified-macro-108621205 branch from 51a5fc9 to 3731c6f Compare December 1, 2023 00:32
@ApolloZhu
Copy link
Contributor Author

@swift-ci please smoke test

@ApolloZhu
Copy link
Contributor Author

@swift-ci please smoke test linux

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

The implementation looks good! As I noted in a few places, the "base" and "member" naming used in clients of destructureMacroRef is a little misleading.

@ApolloZhu
Copy link
Contributor Author

@swift-ci please smoke test

@ApolloZhu ApolloZhu enabled auto-merge (squash) December 7, 2023 22:09
@ApolloZhu
Copy link
Contributor Author

@swift-ci please smoke test

@ApolloZhu ApolloZhu merged commit 5767e8f into swiftlang:main Dec 8, 2023
@rxwei
Copy link
Contributor

rxwei commented Dec 9, 2023

Nice! Should this be cherry-picked to 5.10?

@ApolloZhu ApolloZhu deleted the qualified-macro-108621205 branch December 15, 2023 19:28
Catfish-Man pushed a commit to Catfish-Man/swift that referenced this pull request Jan 19, 2024
)

Allow attached macro expansion syntax to have a module qualifier, `@Foo.Bar`.

rdar: //108621205
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.

Swift macros should be able to use module names as namespaces
3 participants