Skip to content

Conformance macro fixes #64020

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 2 commits into from
Mar 2, 2023
Merged

Conversation

DougGregor
Copy link
Member

Implement two fixes needed for conformance macros to get OptionSet working the way we want:

  • Register the extension for a conformance macro fully. This ensures that we handle the extensions used to register conformances from conformance macros uniformly throughout.
  • Add macro expansion support for conformance macros.

When we form an extension for a conformance macro, make sure to
register that extension as being part of the nominal type to which the
conformance macro is attached. This ensures that the conformance is
seen everywhere. Crucially, this ensures that that protocol
conformance table handles conformances that are implied by the
conformance macro. For example, a conformance macro that introduces a
`Hashable` conformance will also imply an `Equatable` conformance;
that wasn't happening before this change.

This is needed to make the `OptionSet` macro work fully.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@DougGregor
Copy link
Member Author

macOS failure was a TSan issue; not related

@DougGregor DougGregor merged commit b3683c1 into swiftlang:main Mar 2, 2023
@DougGregor DougGregor deleted the conformance-macro-fixes branch March 2, 2023 15:03
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