dialyxir
dialyxir copied to clipboard
Failed to parse warning (calling function on nil)
Environment
-
Erlang: Erlang/OTP 23
-
Elixir: Elixir 1.9.0 (compiled with Erlang/OTP 20)
-
Dialyxir version: 1.0.0
Current behavior
Attempting to call a function on nil is failing to parse
mix dialyzer
output:
Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.
Failed to parse warning:
[]
Legacy warning:
:0: Unknown function nil:dataloader_query/2
mix dialyzer --format raw
output:
{:warn_unknown, {[], 0}, {:unknown_function, {nil, :dataloader_query, 2}}}
Just to post what this turned out to be for me:
I had a compile-time configuration that referenced a module and I had set it for :test
but not for other environments. So my tests passed but dialyzer (rightly!) complained about me trying to call nil.some_function()
in which nil was my missing module reference in the config.
I'm able to reproduce it on Erlang 23.1.1 by inserting this line into any module:
nil.dataloader_query(:any, :args)
I'm not seeing it on Erlang 22, but I also don't see any change in shape in the raw output for this warning. Maybe a bug in yecc??