-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Current behavior
The documentation indicates that which_children returns a list of modules. This is confirmed in the code. It returns a list of modules.
The @spec
for the function indicates it returns a single module or :dynamic.
Thus, the following code matches and works at runtime, but produces a dialyzer error.
[{_, pid, :supervisor, [DynamicSupervisor]}] = Supervisor.which_children(supervisor_pid)
Expected behavior
The @spec
for which_children should be:
which_children(supervisor()) :: [
{term() | :undefined, child() | :restarting, :worker | :supervisor,
[module()] | :dynamic}
]
The change is that the module()
toward the end is in a list.
Note: the :dynamic might need to be in the list too. Not sure without digging in deeper.
Metadata
Metadata
Assignees
Labels
No labels