-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rematch should error if you define two identical match clauses #29
Comments
This is doable, but with the way I think we should consider introducing different macros for the different semantics: |
That's a great idea, @nystrom. I gave up on my effort to rewrite Rematch to use dispatch (in the hopes it would prove more performant, per the problems we saw when upgrading to 1.5), because i realized that it was just way too hard when allowing for full pattern matching. I imagine it would be easier to implement with |
I'll give it a try when I have some more time. Can you submit a separate issue? Do you have a branch with your attempt? |
This definition should raise an error because there are two identical match clauses and the second one is unreachable:
In fact, maybe we should consider erroring in general if there are unreachable clauses? For example, in this definition, the second clause is unreachable because the first clause matches everything, which should also probably raise an error:
The text was updated successfully, but these errors were encountered: