Skip to content

[Macros] Replace all uses of the ConformanceMacro protocol with ExtensionMacro. #67762

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 1 commit into from
Aug 5, 2023

Conversation

hborla
Copy link
Member

@hborla hborla commented Aug 5, 2023

ConformanceMacro provides a default implementation of ExtensionMacro so this is effectively NFC (and most of the changes are in tests anyway).

@hborla hborla requested a review from bnbarham as a code owner August 5, 2023 00:59
@hborla
Copy link
Member Author

hborla commented Aug 5, 2023

@swift-ci please smoke test

return [("OptionSet", nil)]
let ext: DeclSyntax =
"""
extension \(type.trimmed): OptionSet {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we/should we trim the type before passing it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall whether we do (I copied this from elsewhere), but we should if we don't already

extension \(type.trimmed): OptionSet {}
"""

return [ext.cast(ExtensionDeclSyntax.self)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should make ExtensionDeclSyntax SyntaxParseable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please!

@hborla hborla force-pushed the remove-conformance-macro-protocol branch from 6d74182 to d03ef5a Compare August 5, 2023 05:32
@hborla
Copy link
Member Author

hborla commented Aug 5, 2023

@swift-ci please smoke test

@hborla hborla merged commit 5a6aa7b into swiftlang:main Aug 5, 2023
@hborla hborla deleted the remove-conformance-macro-protocol branch August 5, 2023 17:04
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