-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Assist for merging single-body swicth cases with a logical-or pattern #56180
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
Comments
Summary: The user proposes a syntax change to Dart's |
Now that #55861 is closed, a workaround is to do both conversions to and from switch expression. It will give the same result asked above. But it obviously just works when the switch statement can be converted. |
If #59529 is accepted it would work great with this as well. |
Also, #59530 (if accepted) would help ensure duplicates are removed as well as |
This may be a good starting point @paudel-milan. Again, feel free to reach out to me if you have any doubts. |
I think the feature should preserve the original order. Switch cases are rarely integers, so in most cases there's no other good option, but more importantly, there's likely to be a reason for the existing order and it would be better to preserve any semantic information there might be. |
"Thank you, @FMorschel! I appreciate the guidance and the opportunity to contribute. I'll go through the provided resources and reach out if I have any questions. Looking forward to contributing!" |
I'd like to ask for an assist for merging single-body swicth cases with a logical-or pattern
So cases like:
Can become:
Originally posted by @FMorschel in #55861 (comment)
The text was updated successfully, but these errors were encountered: