Skip to content

[5.9][Macros] Generalize conformance macros as extension macros #66982

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 8 commits into from
Jun 29, 2023

Conversation

hborla
Copy link
Member

@hborla hborla commented Jun 28, 2023

  • Explanation: Conformances macros are problematic and limited. This change implements a generalization of conformance macros as extension macros. This allows adding members in extensions, properly extending nested types with a macro expansion that will actually compile if added to the code directly, and enables a path forward for suppressing expanded conformances if the extended type already conforms to the protocol.
  • Issue: rdar://110616211
  • Risk: Low. This change preserves the conformance macro role (for now) rather than replacing it, and extension macros are not yet used.
  • Testing: Added new tests.
  • Main branch PR: [Macros] Generalize conformance macros as extension macros #66967

@hborla hborla requested a review from a team as a code owner June 28, 2023 14:06
@hborla
Copy link
Member Author

hborla commented Jun 28, 2023

swiftlang/swift-syntax#1861

@swift-ci please test

@hborla
Copy link
Member Author

hborla commented Jun 28, 2023

swiftlang/swift-syntax#1861

@swift-ci please test

@hborla hborla changed the title [5.9][Macros] Implement attached extension macros. [5.9][Macros] Generalize conformance macros as extension macros Jun 28, 2023
@hborla
Copy link
Member Author

hborla commented Jun 29, 2023

swiftlang/swift-syntax#1861

@swift-ci please test macOS

@hborla
Copy link
Member Author

hborla commented Jun 29, 2023

swiftlang/swift-syntax#1861

@swift-ci please test

@hborla hborla merged commit d348e3d into swiftlang:release/5.9 Jun 29, 2023
@hborla hborla deleted the 5.9-extension-macros branch June 29, 2023 15:12
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.

2 participants