Skip to content

Emit a warning if a conformance to MemberMacro does not contain the expansion method that takes a conformingTo parameter #2754

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
Jul 30, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 25, 2024

The expansion method that takes a conformingTo has been defaulted to be source-compatible with older versions of swift-syntax that required a version of the expansion function without the conformingTo parameter.

That meant that you could state a conformance to MemberMacro without implementing any methods and you wouldn’t get any compile time diagnostics.

Deprecate the forwarding default implementation so that you get a warning if you are relying on it.

… `expansion` method that takes a `conformingTo` parameter

The `expansion` method that takes a `conformingTo` has been defaulted to be source-compatible with older versions of swift-syntax that required a version of the `expansion` function without the `conformingTo` parameter.

That meant that you could state a conformance to `MemberMacro` without implementing any methods and you wouldn’t get any compile time diagnostics.

Deprecate the forwarding default implementation so that you get a warning if you are relying on it.
@ahoppen ahoppen requested review from rintaro and bnbarham July 25, 2024 23:45
@ahoppen ahoppen requested a review from DougGregor as a code owner July 25, 2024 23:45
@ahoppen
Copy link
Member Author

ahoppen commented Jul 25, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit 3aa0b64 into swiftlang:main Jul 30, 2024
3 checks passed
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