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

[FEATURE] Support break for switch statements #572

Open
1 task done
RevengerWizard opened this issue Nov 25, 2022 · 1 comment
Open
1 task done

[FEATURE] Support break for switch statements #572

RevengerWizard opened this issue Nov 25, 2022 · 1 comment
Labels
feature request Discussion about a new feature

Comments

@RevengerWizard
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

The current implementation of switch statements doesn't really support the ability to break out of it.

Describe the solution you'd like

I'm not really sure how this could be achieved, perhaps by treating the switch statement like a loop?

Describe alternatives you've considered

Similar behaviour could still be achieved by putting the switch statement in a function and just do a return, but it would still be nice to have this other possibility for breaking out of a switch statement.

Additional context

No response

@RevengerWizard RevengerWizard added the feature request Discussion about a new feature label Nov 25, 2022
@RevengerWizard RevengerWizard changed the title [FEATURE] Being able to break out of a switch statement [FEATURE] Support break for switch statements Nov 25, 2022
@Jason2605
Copy link
Member

Hey! Sorry it took me so long to respond to this. I'm actually unsure how I feel about switch statements altogether if I'm being perfectly honest. There are other ways to achieve the same output without using the switch statement. Something to think about going forward with Dictu if I'm honest, we could remove them entirely and try to opt for something a little more powerful with match statements (although this may need some compiler re-jig as .match is used a bit for dealing with Result types).

Definitely a valid gripe if we are to keep switch statements in the language however!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Discussion about a new feature
Projects
None yet
Development

No branches or pull requests

2 participants