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

Unnecessary cases created in switch #6671

Closed
fhammerschmidt opened this issue Mar 10, 2024 · 2 comments
Closed

Unnecessary cases created in switch #6671

fhammerschmidt opened this issue Mar 10, 2024 · 2 comments

Comments

@fhammerschmidt
Copy link
Member

Moved from rescript-association/rescript-lang.org#728

bobrovnikov commented on Oct 20, 2023

Playground: https://rescript-lang.org/try?version=v10.1.2&code=DYUwLgBAzg7glmAxgCwKIA8CGBbADqCAXggAo4A7XAVzAC4IKwBKIgPggG8AoCaeJZA0o1OPXhAD0EiOQD2YOIhAzZEAKwQQ6OFDBQIyEACcQAQjEAfCABY2NyxACMABjsuHjgExvPDgPp2zmIAvlzBQA

Notice how in ReScript I provided 3 specific cases + a default one, while the transpiled code contains much more.

friedbyalice added a commit to friedbyalice/rescript-compiler that referenced this issue Mar 12, 2024
…6671

Signed-Off-By: Vincenzo Pellegrini <dev@enzopellegrini.me>
@friedbyalice
Copy link
Contributor

Is anyone working on this? I was taking a look on #6672

friedbyalice added a commit to friedbyalice/rescript-compiler that referenced this issue Mar 13, 2024
…6671

Signed-Off-By: Vincenzo Pellegrini <dev@enzopellegrini.me>
zth pushed a commit that referenced this issue Mar 13, 2024
* Fix redundant branches in generated switch body, fixes #6671

Signed-Off-By: Vincenzo Pellegrini <dev@enzopellegrini.me>

* Updated changelog

---------

Signed-off-by: Vincenzo Pellegrini <dev@enzopellegrini.me>
@fhammerschmidt
Copy link
Member Author

Thanks!

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

No branches or pull requests

2 participants