Supervisor.Spec.spec() is the older tuple-style child
spec. ConsumerSupervisor.init/2 support the newer map-style child specs,
but the type did not not reflect that. That resulted in Dialyzer errors like
this:
example.ex:8:no_return
Function start_link/1 has no local return.
________________________________________________________________________________
example.ex:24:call
The function call will not succeed.
ConsumerSupervisor.start_link(
_children :: [
%{:id => _, :restart => :temporary, :start => {_, :start_link, [Keyword.t(), ...]}},
...
],
_supervisor_opts :: [{atom(), _}, ...]
)
breaks the contract
Contract head:
([Supervisor.Spec.spec()], [option()]) :: Supervisor.on_start()
Contract head:
(module(), any()) :: Supervisor.on_start()
This updates the spec to show that start_link/2 can also accept a map.
Supervisor.Spec.spec()
is the older tuple-style child spec.ConsumerSupervisor.init/2
support the newer map-style child specs, but the type did not not reflect that. That resulted in Dialyzer errors like this:This updates the spec to show that
start_link/2
can also accept a map.