Skip to content

[5.9] [Module printing] Don't print attached macros in generated interfaces #66150

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 May 25, 2023

  • Explanation: Swift module interface printing was printing both a use of an attached macro (e.g., @Observable) and the result of expanding that macro, leading to Swift interface files that can't be correctly processed. The fix is to not print the use of the attached macro, and instead only print the results of macro expansion.
  • Scope: Narrow; only affects module interface printing for public declarations that have attached macros.
  • Risk: Low; suppressing printing custom attributes in Swift module interfaces that resolve to macros.
  • Issue: rdar://109378191
  • Original pull request: [Module printing] Don't print attached macros in generated interfaces #66131

Macros are expanded as part of interface generation, so they shouldn't
also be printed into the Swift interface.

Fixes rdar://109378191.
@DougGregor DougGregor requested a review from a team as a code owner May 25, 2023 21:06
@DougGregor
Copy link
Member Author

@swift-ci please test

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit 0763971 into swiftlang:release/5.9 May 26, 2023
@DougGregor DougGregor deleted the interfaces-without-macros-5.9 branch May 26, 2023 13:39
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