Skip to content

[Macros] Eliminate ordering dependency that suppressed conformingTo protocols #79195

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

Conversation

DougGregor
Copy link
Member

When a macro that has both 'member' and 'extension' roles is on a type, and both list conforming protocols, the order in which those roles were evaluated in the compiler could change the set of protocols passed to the macro expansion function (via conformingTo:). Specifically, if the extension macro was expanded first, the member macro would see the extension providing the conformance to one of its protocols, and not pass down that protocol to the member macro's conformingTo:.

Ensure that we account for already-expanded extension macros that define conformances.

Fixes rdar://137080876.

…rotocols

When a macro that has both 'member' and 'extension' roles is on a type,
and both list conforming protocols, the order in which those roles were
evaluated in the compiler could change the set of protocols passed to
the macro expansion function (via `conformingTo:`). Specifically, if
the extension macro was expanded first, the member macro would see the
extension providing the conformance to one of its protocols, and not
pass down that protocol to the member macro's `conformingTo:`.

Ensure that we account for already-expanded extension macros that
define conformances.

Fixes rdar://137080876.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor enabled auto-merge February 6, 2025 19:22
@DougGregor
Copy link
Member Author

Linux failure is unrelated

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor DougGregor disabled auto-merge February 6, 2025 23:57
@DougGregor DougGregor enabled auto-merge February 6, 2025 23:57
@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor DougGregor merged commit 3637e69 into swiftlang:main Feb 7, 2025
3 checks passed
@DougGregor DougGregor deleted the expand-conformances-member-ordering branch February 7, 2025 18:45
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