jeremyjh / dialyxir

Mix tasks to simplify use of Dialyzer in Elixir projects.
Apache License 2.0
1.69k stars 141 forks source link

Undeprecate `plt_add_deps: :transitive` or provide alternative #476

Closed rewritten closed 1 year ago

rewritten commented 1 year ago

Environment

Erlang/OTP 25 [erts-13.1.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Elixir 1.14.3 (compiled with Erlang/OTP 25)

1.0.0

Current behavior

In a project that uses a function from a dependency (which is not a stand-alone app), with the default configuration, it shows

Function OpentelemetryProcessPropagator.Task.async/1 does not exist.

despite being used successfully in tests. This is because the default config is :app_tree, which only takes into account app dependencies, not library dependencies.

When configured with plt_add_deps: :transitive, mix dialyzer complains of the deprecation, but finds the function and does not fail.

Expected behavior

There should be a non-deprecated way to take into account functions in all direct dependencies (the :transitive option uses all the dependencies but I'm not sure it's needed)

rewritten commented 1 year ago

Oh. We can use plt_add_deps: true that takes into account direct dependencies.