Skip to content

[6.2] Introduce try/await/unsafe macro lexical contexts with unfolded sequence handling #3041

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
merged 3 commits into from
Apr 7, 2025

Conversation

hamishknight
Copy link
Contributor

6.2 cherry-pick of #3037

  • Explanation: Adds macro lexical context nodes for try, await, and unsafe
  • Scope: Affects the lexical context exposed to macros
  • Issue: rdar://109470248
  • Risk: Low, this only adds new lexical context nodes
  • Testing: Added tests to test suite
  • Reviewer: Doug Gregor

stmontgomery and others added 3 commits April 4, 2025 15:41
… expression macro in lexicalContext

Resolves rdar://109470248
We can say that any `try`/`await` element also covers all elements to
the right of it in an unfolded sequence. Cases where this isn't true
will be rejected by the compiler, e.g:

```
0 * try foo() + bar()
_ = try foo() ~~~ bar() // Assuming `~~~` has lower precedence than `=`
```

rdar://109470248
Match the behavior of `try` and `await`.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight requested review from a team and removed request for DougGregor and ahoppen April 7, 2025 09:34
@hamishknight hamishknight merged commit 9aa0907 into swiftlang:release/6.2 Apr 7, 2025
26 checks passed
@hamishknight hamishknight deleted the in-sequence-6.2 branch April 7, 2025 15:32
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.

3 participants