Skip to content

[Macros] Properly compute the innermost declaration context of a macro. #64807

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

@DougGregor DougGregor commented Mar 31, 2023

  • Explanation: A core operation to find the "innermost" declaration context for a macro declaration was incorrect, leading to the type checker rejecting obviously-correct generic macro declarations.
  • Scope: Affects generic macro declarations.
  • Risk: Low; only affects generic macro declarations that were incorrectly rejected before.
  • Issue: rdar://107479809
  • Testing: Additional tests added.
  • Original pull request: [Macros] Properly compute the innermost declaration context of a macro. #64806

How did we go this long without having the right context? Who knows.
The fix is trivial and obvious.

The failure mode here is that we wouldn't get an appropriate generic
context in the result type of a macro, so we would complain about
generic parameters not meeting their own generic requirements.
@DougGregor DougGregor requested a review from a team as a code owner March 31, 2023 05:39
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit 2b400a1 into swiftlang:release/5.9 Mar 31, 2023
@DougGregor DougGregor deleted the innermost-macro-context-5.9 branch March 31, 2023 13:45
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants