Skip to content

Dialyzer notifies an error with typespec for DynamicSupervisor.init/1 #7666

@PaoloLaurenti

Description

@PaoloLaurenti

The issue explained inside the PR #7596 is still present.
That patch has been released with the 1.6.5 version but I still face the issue with this version.

Environment

  • Elixir & Erlang/OTP versions (elixir --version): Elixir 1.6.5 / Erlang 20.3.1
  • Operating system: Ubuntu 17.10

Current behavior

With this code

defmodule TestDynamicSup do
  use DynamicSupervisor

  @spec init(arg :: any()) :: {:ok, DynamicSupervisor.sup_flags()} | :ignore
  @impl DynamicSupervisor
  def init(_arg), do: DynamicSupervisor.init(strategy: :one_for_one)

end

dialyzer notifies this error:

Starting Dialyzer
dialyzer args: [
  check_plt: false,
  init_plt: '/home/paolo/dev/priv/learning/elixir/test_dynamic_sup/_build/dev/dialyxir_erlang-20.3.1_elixir-1.6.5_deps-dev.plt',
  files_rec: ['/home/paolo/dev/priv/learning/elixir/test_dynamic_sup/_build/dev/lib/test_dynamic_sup/ebin'],
  warnings: [:unknown]
]
done in 0m0.89s
lib/test_dynamic_sup.ex:4: The specification for 'Elixir.TestDynamicSup':init/1 has an opaque subtype 'Elixir.DynamicSupervisor':sup_flags() which is violated by the success typing (_) -> {'ok',#{'extra_arguments':=_, 'max_children':=_, 'strategy':=_, _=>_}}

Expected behavior

No error from Dialyzer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions