Closed darrenklein closed 1 year ago
I met similar error and got this stacktrace when running with short
formatter.
mix dialyzer --format short
:
** (throw) {:error, :unknown_warning, :callback_not_exported}
lib/dialyxir/formatter/short.ex:22: Dialyxir.Formatter.Short.warning/1
lib/dialyxir/formatter/short.ex:10: Dialyxir.Formatter.Short.format/1
(elixir 1.14.1) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
lib/dialyxir/formatter.ex:33: Dialyxir.Formatter.format_and_filter/4
lib/dialyxir/dialyzer.ex:59: Dialyxir.Dialyzer.Runner.run/2
lib/dialyxir/dialyzer.ex:81: Dialyxir.Dialyzer.dialyze/3
lib/mix/tasks/dialyzer.ex:271: Mix.Tasks.Dialyzer.run_dialyzer/2
lib/mix/tasks/dialyzer.ex:203: Mix.Tasks.Dialyzer.run/1
looks like :callback_not_exported
is not a known warning of dialyxir. and then I did a quick search of :callback_not_exported
, I found this warning was introduced https://github.com/erlang/otp/commit/5502f87db8cbe4936e1f255035d3f47f8d963d66, which is since Erlang OTP 25.1.
@shutangyu Thanks!
Hello, thank you very much for all of your hard work on this project. I'm just filing this report because the output from running
mix dialyzer
instructed me to.Environment
Elixir & Erlang/OTP versions (elixir --version): Elixir 1.14.0 (compiled with Erlang/OTP 25)
Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir): 1.1.0
Current behavior
When running
mix dialyzer
, I see the following output instructing me to file this bug report:This is referring to a module where I have included
use Plug.ErrorHandler
, but accidentally defined thehandle_errors
callback as a private function. This is easy enough for me to resolve in my code, but maybe this is an edge case for dialyxer?seems like you could replicate with any module with something like
This is sort of an interesting case, I guess - the
__using__/1
definition inPlug.ErrorHandler
is as follows:So it includes the
Plug.ErrorHandler
behavior, defines a default callback forhandle_errors/2
, but then allows that definition to be overridden - however,defoverride
allows a function to be overridden with a private function, which is what's happened here... so a callback has been overridden with a private function.