Skip to content

[6.2] [CS] Make sure macro arguments go through coerceCallArguments #80605

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

hamishknight
Copy link
Contributor

6.2 cherry-pick of #80583

  • Explanation: Fixes an issue where the implicit self diagnostic would incorrectly trigger in non-escaping closures passed as macro arguments
  • Scope: Fixes macro type-checking such that arguments are correctly coerced
  • Issue: rdar://148665502, Unexpected warnings when capturing self in closures passed to macros #80561
  • Risk: Low/Medium, applies existing logic to more cases
  • Testing: Added tests to test suite
  • Reviewer: Holly Borla, Pavel Yaskevich

Previously we would avoid rewriting the arguments in CSApply, but
that can result in incorrect behavior in MiscDiagnostics passes, e.g
incorrectly treating all closure arguments as escaping. Make sure
we rewrite the arguments as we would in regular type-checking.

rdar://148665502
@hamishknight hamishknight added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Apr 7, 2025
@hamishknight hamishknight requested a review from bnbarham April 7, 2025 18:04
@hamishknight hamishknight requested a review from a team as a code owner April 7, 2025 18:04
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit ead547d into swiftlang:release/6.2 Apr 8, 2025
5 checks passed
@hamishknight hamishknight deleted the macro-arg-apply-6.2 branch April 8, 2025 10:51
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 swift 6.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants