Skip to content

[Macros] Allow extension macros to suppress conformances that are stated in the original source. #67070

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
Jul 3, 2023

Conversation

hborla
Copy link
Member

@hborla hborla commented Jun 30, 2023

If an extension macro can introduce protocol conformances, macro expansion will check which of those protocols already have a stated conformance in the original source. The protocols that don't will be passed as arguments to extension macro expansion, indicating to the macro that it should only add conformances to those protocols.

Resolves: rdar://111464321

@hborla hborla requested a review from DougGregor June 30, 2023 21:22
hborla added 3 commits June 30, 2023 14:25
ConformanceMacro now refines ExtensionMacro, so these roles can share
the same expansion request.
…eady

stated in the original source.

If an extension macro can introduce protocol conformances, macro expansion
will check which of those protocols already have a stated conformance in the
original source. The protocols that don't will be passed as arguments to
extension macro expansion, indicating to the macro that it should only add
conformances to those protocols.
@hborla hborla force-pushed the refine-extension-macros branch from da52316 to 0bd898e Compare June 30, 2023 23:01
@hborla hborla marked this pull request as ready for review June 30, 2023 23:07
@hborla hborla requested review from rintaro and removed request for xedin, CodaFi, zoecarver and AnthonyLatsis June 30, 2023 23:08
@hborla
Copy link
Member Author

hborla commented Jun 30, 2023

swiftlang/swift-syntax#1871

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Jun 30, 2023

swiftlang/swift-syntax#1871

@swift-ci please build toolchain

@hborla hborla requested a review from hamishknight as a code owner July 1, 2023 05:54
@hborla
Copy link
Member Author

hborla commented Jul 1, 2023

swiftlang/swift-syntax#1871

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Jul 1, 2023

swiftlang/swift-syntax#1871

@swift-ci please build toolchain

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