Skip to content

[6.0] Properly deprecate default implementation of MacroExpansionContext.lexicalContext #2698

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

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 25, 2024

  • Explanation: Now that we have rdar://123403268, we can change the default implementation of MacroExpansionContext.lexicalContext to return an empty array and be deprecated, making not implementing lexicalContext a compile-time warning instead of a runtime error.
  • Scope: Very narrow, only types conforming to MacroExpansionContext, which clients of the library generally shouldn’t be doing
  • Risk: Low, the scope is very narrow and shouldn’t affect anyone in practice. This is just clean-up
  • Testing: Manually tested that the deprecation message shows up if a user conforms a type to MacroExpansionContext without adding a lexicalContext member
  • Issue: rdar://123410459
  • Reviewer: @rintaro on Properly deprecate default implementation of MacroExpansionContext.lexicalContext #2695

…exicalContext`

Now that we have, we can change the default implementation of `MacroExpansionContext.lexicalContext` to return an empty array and be deprecated, making not implementing `lexicalContext` a compile-time warning instead of a runtime error.

rdar://123410459
@ahoppen ahoppen requested a review from DougGregor as a code owner June 25, 2024 00:56
@ahoppen ahoppen requested a review from bnbarham June 25, 2024 00:56
@ahoppen
Copy link
Member Author

ahoppen commented Jun 25, 2024

@swift-ci Please test

@ahoppen ahoppen changed the title Properly deprecate default implementation of `MacroExpansionContext.l… Properly deprecate default implementation of MacroExpansionContext.lexicalContext Jun 25, 2024
@ahoppen ahoppen changed the title Properly deprecate default implementation of MacroExpansionContext.lexicalContext [6.0] Properly deprecate default implementation of MacroExpansionContext.lexicalContext Jun 25, 2024
@ahoppen
Copy link
Member Author

ahoppen commented Jun 25, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit c18e9ca into swiftlang:release/6.0 Jun 26, 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