Open 41412bb9-c79a-4f5a-8a7f-383cb40aa74b opened 6 years ago
An easier and more general fixit would be to offer to insert a fallthrough. In case the user binds arguments in a tuple pattern, merging cases like this would need to do a rename on those arguments and any uses of them in the case body under the final pattern. Come to think of it, this would make a great refactoring action.
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Improvement | |Assignee | None | |Priority | Medium | md5: c81fffcf7a2007158fa3f9510255f010Issue Description:
Multiple empty
case
labels inswitch
are a common idiom in C family languages.In current Swift, this is diagnosed as:
However, the intention here is probably
0
or1
:We should offer a fix-it to this as well.