Skip to content

[5.9][Macros] Add attached extension macros. #1861

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

Conversation

hborla
Copy link
Member

@hborla hborla commented Jun 28, 2023

  • Explanation: This is the SwiftSyntax-side change to [5.9][Macros] Generalize conformance macros as extension macros swift#66982. 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] Add attached extension macros. #1859

hborla added 3 commits June 28, 2023 06:41
`expandAttachedMacro`.

(cherry picked from commit 50bacd8)
@hborla
Copy link
Member Author

hborla commented Jun 28, 2023

swiftlang/swift#66982

@swift-ci please test

(cherry picked from commit d11f4c7)
@hborla
Copy link
Member Author

hborla commented Jun 28, 2023

swiftlang/swift#66982

@swift-ci please test

hborla added 2 commits June 28, 2023 15:13
… macros

and add a macro plugin test for extension macros.

(cherry picked from commit 1286637)
@hborla
Copy link
Member Author

hborla commented Jun 28, 2023

swiftlang/swift#66982

@swift-ci please test

1 similar comment
@hborla
Copy link
Member Author

hborla commented Jun 29, 2023

swiftlang/swift#66982

@swift-ci please test

@hborla hborla force-pushed the 5.9-extension-macros branch from b2f1f82 to ebbe1b4 Compare June 29, 2023 04:16
@hborla
Copy link
Member Author

hborla commented Jun 29, 2023

swiftlang/swift#66982

@swift-ci please test

hborla added 2 commits June 28, 2023 23:18
…with

PluginMessages.swift in the Swift repository.

(cherry picked from commit 0c1634b)
@hborla
Copy link
Member Author

hborla commented Jun 29, 2023

swiftlang/swift#66982

@swift-ci please test

@hborla
Copy link
Member Author

hborla commented Jun 29, 2023

swiftlang/swift#66982

@swift-ci please test Windows

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