-
Notifications
You must be signed in to change notification settings - Fork 13
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
Clause cannot be reached error #52
Comments
Hi, @Fl4m3Ph03n1x! Thanks for the new report. I'll start from the bottom:
This is a known issue most recently reported in #51. There's an upstream ticket tracking it josefs/Gradualizer#387. These two, on the other hand, look similar to example of the regressions mentioned in josefs/Gradualizer#359:
This needs a double check on our side, but at least we know where to start. If you have some extra time, could you run the check again with Gradient from this branch - https://github.com/esl/gradient/tree/use-erszcz-master? It's not ready for prime time yet, but it incorporates the WIP fixes from josefs/Gradualizer#359. |
Same issue:
This is how my defp deps,
do: [
{:gradient,
git: "[email protected]:esl/gradient.git",
branch: "use-erszcz-master",
only: [:dev],
runtime: false}
] |
Thanks, @Fl4m3Ph03n1x 👍 This means the |
Hello there, any news regarding this issue? |
Hey, @Fl4m3Ph03n1x! #61 and josefs/Gradualizer#387 are fixed and closed, so
shouldn't happen anymore. If you still see it happening with structs, please let us know here or create a new ticket. Whether
are a manifestation of the list exhaustiveness checking regressions is not completely clear yet, but there's ongoing work upstream, most recently tracked as josefs/Gradualizer#404, to fix that. Apparently, it's not trivial 😆 We're going in the right direction, though! |
I've encountered a similar error but without using protocols.
The function is basically
And that last clause with throwing causes:
I figured you might like more data points to test :) |
Hi, @tomekowal!
Sure, these are always welcome! Thanks for the example :) |
This might be a duplicate with #32. |
Ok, even with #72 the errors:
Are returned for this code:
So it means the problem is specific to protocols, i.e. using |
Background
I am trying to implement a couple of protocols in a module but Gradualizer is complaining saying my code is not reachable. The code works without issues, so I am confused.
Code
Here is a simplification of the source code:
Here the errors:
line 9:
defimpl Collectable do
line 14:
defimpl Enumerable do
line 28 does not accept
any
, but there is a clause for that after. By that logic, the linedef reduce([], {:cont, acc}, _fun), do: {:done, acc}
does not acceptany
as the first parameter and yet the tool wont complain.Simply put, I cover all cases of the spec.
I would expect to see no errors.
The text was updated successfully, but these errors were encountered: