Skip to content

[CS] Unify ReturnStmt handling #71272

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 2 commits into from
Feb 1, 2024

Conversation

hamishknight
Copy link
Contributor

Unify the implementation between single-expression and multi-statement closures. Because we're now storing a contextual type for single expression closure returns, update a code completion test to bring its behavior inline with the multi-statement case.

@hamishknight hamishknight force-pushed the cleanup-return branch 2 times, most recently from 83b2053 to 0da6c25 Compare January 31, 2024 20:07
@hamishknight
Copy link
Contributor Author

Source compat run passed except for an issue that looks unrelated

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.

Looks great!

This wasn't consistently used, and consequently
could result in some expressions getting their
parents invalidated. Instead, replace it with a
query to make sure we don't try and add an
expression we've already computed the parent info
for.
Unify the implementation between single-expression
and multi-statement closures. Because we're now
storing a contextual type for single expression
closure returns, update a code completion test to
bring its behavior inline with the multi-statement
case.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Change in code completion behavior looks reasonable to me.

@hamishknight hamishknight merged commit 956d6d2 into swiftlang:main Feb 1, 2024
@hamishknight hamishknight deleted the cleanup-return branch February 1, 2024 09:07
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