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

Failed to parse warning (calling function on nil) #410

Open
insprac opened this issue Aug 23, 2020 · 2 comments
Open

Failed to parse warning (calling function on nil) #410

insprac opened this issue Aug 23, 2020 · 2 comments

Comments

@insprac
Copy link

insprac commented Aug 23, 2020

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}}}
@DarkMarmot
Copy link

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.

@jeremyjh
Copy link
Owner

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??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants