Skip to content
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

[Sema/SILGen] Support for fallthrough into cases with pattern variables. #14041

Merged
merged 1 commit into from
Jan 23, 2018

Conversation

gregomni
Copy link
Contributor

This is the simplest / most-restrictive version of this feature. The previous case that we're falling from must have a superset of the bindings of the case we're falling into and all the to-case bindings must match name and type exactly the corresponding from-case binding.

Fallthrough error diagnoses changed for these new rules, Sema changed to check them, SILGen extended to use the same phi argument passing between case blocks for fallthrough that it was already using for multiple patterns. Finally, VarDeclUsage checker changed so that a binding falling through to a next case counts as a read of that decl.

Tests for all the above, including separate SILGen testing for fallthrough of address-only types that @slavapestov recently fixed for multiple patterns.

@gregomni
Copy link
Contributor Author

@swift-ci Please smoke test.

@gregomni
Copy link
Contributor Author

@slavapestov Would you like to review or shall I merge? (Primarily my hesitation is just being unsure of what process this sort of enhancement ought to take as it's somewhere in between just a bug fix and not yet an evolution-discussion-requiring feature.)

@jckarter
Copy link
Contributor

@slavapestov's out right now, but this LGTM. Thanks Greg!

@gregomni
Copy link
Contributor Author

Thanks @jckarter!

@gregomni gregomni merged commit 0520216 into swiftlang:master Jan 23, 2018
@gregomni gregomni deleted the fallthrough branch August 18, 2020 23:12
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.

None yet

2 participants