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

add dialyzer and fix type errors #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

flaviogrossi
Copy link

  • fixed one typo in start_link type spec
  • removed validate_child/1 catchall clause, since it is not reachable because its input is fixed to Supervisor.child_spec/2 return value

Maybe the catchall clause can be kept despite the error and instead a dialyzer ignore can be used just to be explicit about the intended function behaviour, but I think it's better to remove dead code anyway.

dialyzer report before the fix:

lib/pogo/dynamic_supervisor.ex:33:unknown_type
Unknown type: Supervised.name/0.
________________________________________________________________________________
lib/pogo/dynamic_supervisor.ex:450:pattern_match_cov
The pattern
variable_other

can never match, because previous clauses completely cover the type
%{
  :id => _,
  :start => {atom(), atom(), [any()]},
  :modules => :dynamic | [atom()],
  :restart => :permanent | :temporary | :transient,
  :shutdown => :brutal_kill | :infinity | pos_integer(),
  :type => :supervisor | :worker
}.

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

Successfully merging this pull request may close these issues.

1 participant