Skip to content

add dialyzer and fix type errors#3

Open
flaviogrossi wants to merge 2 commits into
team-telnyx:mainfrom
flaviogrossi:fix_dialyzer_errors
Open

add dialyzer and fix type errors#3
flaviogrossi wants to merge 2 commits into
team-telnyx:mainfrom
flaviogrossi:fix_dialyzer_errors

Conversation

@flaviogrossi
Copy link
Copy Markdown

  • 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