Skip to content

[CS] Fix DeclContext for multi-statement closure captures #79446

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 1 commit into from
Feb 18, 2025

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Feb 17, 2025

Make sure we set the correct DeclContext for CSGen of multi-statement closure captures, since otherwise the DeclContext is set to the closure itself, which is wrong.

Resolves #79444

@hamishknight hamishknight marked this pull request as draft February 17, 2025 22:20
@hamishknight
Copy link
Contributor Author

Going to see if I can change the SyntacticElementContext instead

@hamishknight hamishknight changed the title [CS] Fix DeclContext for multi-statement captures [CS] Fix DeclContext for multi-statement closure captures Feb 18, 2025
Make sure we set the correct DeclContext for CSGen
of multi-statement closure captures, since
otherwise the DeclContext is set to the closure
itself, which is wrong.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@hamishknight hamishknight marked this pull request as ready for review February 18, 2025 11:30
@hamishknight hamishknight requested a review from xedin February 18, 2025 11:32
Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, thank you!

@hamishknight hamishknight merged commit 425dd9c into swiftlang:main Feb 18, 2025
7 checks passed
@hamishknight hamishknight deleted the context-again branch February 18, 2025 20:37
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.

Compiler crash on string interpolation in multi-statement closure capture list
2 participants