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

Deactivate maybeMap generation #562

Closed
aloisdeniel opened this issue Nov 26, 2021 · 3 comments
Closed

Deactivate maybeMap generation #562

aloisdeniel opened this issue Nov 26, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@aloisdeniel
Copy link

aloisdeniel commented Nov 26, 2021

Is your feature request related to a problem? Please describe

The maybeMap method from generated unions introduced a lot of issues in my recent projects. Union cases were added later on during development and were not processed in many places where maybeMap is used.

Describe the solution you'd like

I would like to deactivate the maybeMap method generation (with a build.yaml options?) to enforce all developers to process every state each time a new state is introduced in a union type.

Describe alternatives you've considered

We have considered adding a lint rule at the dev/CI level.

@realshovanshah
Copy link

Can we do the same for the copyWith method? @Lyokone would your help be possible in this too? I'll try to see if I can create a PR first.

@Lyokone
Copy link
Contributor

Lyokone commented Jan 24, 2022

Hey, the PR should be pretty similar to #565. Happy to help if needed. Not sure what would be the use case tho?

@realshovanshah
Copy link

I have filled an issue describing the my problem here: #587.
#576 also seemed to have a use case for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants