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

The clause on line X cannot be reached #32

Open
eksperimental opened this issue Feb 7, 2022 · 2 comments
Open

The clause on line X cannot be reached #32

eksperimental opened this issue Feb 7, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@eksperimental
Copy link
Contributor

eksperimental commented Feb 7, 2022

This is my project and commit
https://github.com/eksperimental/beam_langs_meta_data/tree/26ecd958475bedd5c0e4204814e7437484acdff4

Error:

lib/beam_langs_meta_data.ex: The clause on line 395 cannot be reached

https://github.com/eksperimental/beam_langs_meta_data/blob/26ecd958475bedd5c0e4204814e7437484acdff4/lib/beam_langs_meta_data.ex#L395

The line is reachable from IEx though

@erszcz erszcz added the triage Needs assessment whether a bug, enhancement, duplicate, ... label Feb 10, 2022
This was referenced Apr 27, 2022
@erszcz
Copy link
Member

erszcz commented Apr 28, 2022

This does not seem to be connected with #72. This means it's likely connected with multiple spec clauses on the function in question, that is josefs/Gradualizer#410. This is confirmed by the fact that the warning goes away when we rewrite the spec to the following (less strict) version:

-  @spec compatibility({:elixir, :otp}) :: %{
-          elixir_version_key => nonempty_list(otp_version_key)
-        }
-  @spec compatibility({:otp, :elixir}) :: %{
-          otp_version_key => nonempty_list(elixir_version_key)
+  @spec compatibility({:elixir, :otp} | {:otp, :elixir}) :: %{
+          (elixir_version_key | otp_version_key) => nonempty_list(otp_version_key) | nonempty_list(elixir_version_key)
         }

@erszcz erszcz added bug Something isn't working and removed triage Needs assessment whether a bug, enhancement, duplicate, ... labels Apr 28, 2022
@baldwindavid
Copy link

I'm testing out gradient on a PR in the ExWaiter package and seem to be hitting cases where a typespec does not cover multiple function heads...
https://github.com/baldwindavid/ex_waiter/pull/3/files#diff-a502442c0bd637c012b9c3bd3788d431af95331497257e34e1a53bb8a5446f49R258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants