Skip to content

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

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

Conversation

DougGregor
Copy link
Member

  • 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 26, 2023 04:31
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test macOS

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please test macOS

@DougGregor DougGregor merged commit f47d666 into swiftlang:release/5.9-20230510 May 30, 2023
@DougGregor DougGregor deleted the interfaces-without-macros-5.9-20230510 branch May 30, 2023 21:30
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