When I run “mix dialyzer”, I get errors about the new “significant” and “auto_shutdown” options. What’s confusing me is that the VS Code ElixirLS extension does NOT complain about these.
Why are they different? How do I fix this?
I’m using Elixir 1.12.1, with OTP-24.0.2.
$ elixir --version
Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.12.1 (compiled with Erlang/OTP 24)
Specifically:
The function call will not succeed.
Supervisor.start_child(_sup :: pid(), %{
:id => MyParentSupervisor,
:restart => :temporary,
:significant => true,
:start => {MySupervisor, :start_link, []},
:type => :supervisor
})
will never return since it differs in arguments with
positions 2nd from the success typing arguments:
(
atom() | pid() | {atom(), _} | {:via, atom(), _},
atom()
| maybe_improper_list()
| {atom(), _}
| {_, _, _, _, _, _}
| %{
:id => _,
:start => {atom(), atom(), [any()]},
:modules => :dynamic | [atom()],
:restart => :permanent | :temporary | :transient,
:shutdown => :brutal_kill | timeout(),
:type => :supervisor | :worker
}
)
The specs look correct in OTP-24’s supervisor.erl.
It’s not complaining about the {:ok, {%{:strategy => :one_for_one, :auto_shutdown => :any_significant}, []}}
that I’m returning from init/1
.