Open datafoo opened 4 years ago
This solution is nonsatisfying, but remove your PLT and PLT hash file, then rerun, and it will work.
This solution is nonsatisfying, but remove your PLT and PLT hash file, then rerun, and it will work.
I do not have any PLT or PLT hash file in _build/dev/
so that does not work for me.
this happens often to us as well since switching to elixir 1.10
The same in my project, the error started happening with Elixir 1.10+.
@datafoo try $ rm ~/.mix/*.plt
@datafoo Also try removing the PLTs in ~/.mix/. I'm on macOS (homebrew) and I think sometimes erlang upgrades without a version change break dialyzer. Removing those fixes it for me, it is annoying though since dialyzer has to rebuild PLTs from scratch.
https://github.com/jeremyjh/dialyxir/issues/387#issuecomment-663688254
On macOS with Brew installed Elixir 1.10 and Erlang 23 and this seems to be the magic fix.
I'm seeing the same error in this CI:
** (CaseClauseError) no case clause matching: {{:nocatch, {:dialyzer_error, [70, 105, 108, 101, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 58, 32, '/home/runner/work/_temp/.setup-elixir/otp/lib/hipe-4.0.1/ebin/erl_bif_types.beam', 10]}}, [{:dialyzer_plt, :compute_md5_from_file, 1, [file: 'dialyzer_plt.erl', line: 543]}, {:dialyzer_plt, :compute_new_md5_1, 3, [file: 'dialyzer_plt.erl', line: 509]}, {:dialyzer_plt, :check_version, 1, [file: 'dialyzer_plt.erl', line: 328]}, {:dialyzer_plt, :from_file1, 3, [file: 'dialyzer_plt.erl', line: 267]}, {:dialyzer_plt, :"-subproc/1-fun-0-", 1, [file: 'dialyzer_plt.erl', line: 603]}]}
dialyzer_plt.erl:256: :dialyzer_plt.from_file/2
dialyzer_cl.erl:371: :dialyzer_cl."-do_analysis/1-lc$^0/1-0-"/1
dialyzer_cl.erl:371: :dialyzer_cl.do_analysis/1
dialyzer.erl:160: :dialyzer.run/1
(stdlib 3.14.1) timer.erl:181: :timer.tc/2
lib/dialyxir/dialyzer.ex:47: Dialyxir.Dialyzer.Runner.run/2
lib/dialyxir/dialyzer.ex:75: Dialyxir.Dialyzer.dialyze/3
lib/mix/tasks/dialyzer.ex:269: Mix.Tasks.Dialyzer.run_dialyzer/2
lib/mix/tasks/dialyzer.ex:201: Mix.Tasks.Dialyzer.run/1
(mix 1.11.4) lib/mix/task.ex:394: Mix.Task.run_task/3
(mix 1.11.4) lib/mix/cli.ex:84: Mix.CLI.run_task/2
(elixir 1.11.4) lib/code.ex:931: Code.require_file/2
Error: Process completed with exit code 1.
https://github.com/jshmrtn/hygeia/runs/2389642977?check_suite_focus=true
Clearing the cache solved the issue.
Environment
Current behavior
Running
mix dialyzer
throws aCaseClauseError
when using Elixir 1.10.You can reproduce with the minimal test project https://github.com/datafoo/elixir-dialyzer-issue-CaseClauseError. Note that I set my development environment with
nix-shell
, hence the filesnixpkgs.nix
,default.nix
andshell.nix
.Expected behavior
Running
mix dialyzer
should not throw an error. When using Elixir 1.9.4, there is no errors.