Skip to content

[Macros] Enable global peer macros.#63598

Merged
hborla merged 2 commits intoswiftlang:mainfrom
hborla:global-peer-macros
Feb 15, 2023
Merged

[Macros] Enable global peer macros.#63598
hborla merged 2 commits intoswiftlang:mainfrom
hborla:global-peer-macros

Conversation

@hborla
Copy link
Copy Markdown
Member

@hborla hborla commented Feb 11, 2023

Global peer macro expansions are not injected into the AST. Instead, they are visited as "auxiliary declarations" when needed, such as in the decl checker and during SILGen. This is the same mechanism used for local property wrappers and local lazy variables.

Note that peer macros are not yet expanded during name lookup.

@hborla
Copy link
Copy Markdown
Member Author

hborla commented Feb 11, 2023

@swift-ci please build toolchain

@hborla hborla marked this pull request as draft February 11, 2023 20:02
@xedin xedin removed their request for review February 13, 2023 21:06
@hborla hborla force-pushed the global-peer-macros branch from 1871085 to d24e620 Compare February 14, 2023 02:43
@hborla hborla marked this pull request as ready for review February 14, 2023 03:27
@hborla hborla requested a review from zoecarver as a code owner February 14, 2023 03:27
@hborla
Copy link
Copy Markdown
Member Author

hborla commented Feb 14, 2023

@swift-ci please smoke test

@hborla
Copy link
Copy Markdown
Member Author

hborla commented Feb 14, 2023

@swift-ci please smoke test macOS

@hborla hborla force-pushed the global-peer-macros branch from 97bd910 to b5b922e Compare February 15, 2023 00:20
Global peer macro expansions are not injected into the AST. Instead, they
are visited as "auxiliary declarations" when needed, such as in the decl
checker and during SILGen. This is the same mechanism used for local property
wrappers and local lazy variables.
…criminator

when creating the macro expansion context.
@hborla hborla force-pushed the global-peer-macros branch from b5b922e to 46db62b Compare February 15, 2023 00:24
@hborla
Copy link
Copy Markdown
Member Author

hborla commented Feb 15, 2023

@swift-ci please smoke test

@hborla hborla merged commit a18eebf into swiftlang:main Feb 15, 2023
@hborla hborla deleted the global-peer-macros branch February 15, 2023 04:15
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.

1 participant