8000 `Oidcc.ProviderConfiguration.Worker.child_spec` typespec problem · Issue #394 · erlef/oidcc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Oidcc.ProviderConfiguration.Worker.child_spec typespec problem #394
Closed
@LostKobrakai

Description

@LostKobrakai

oidcc version

3.2.4

Erlang version

27.1.2

Elixir version

1.17.3

Summary

Oidcc.ProviderConfiguration.Worker.child_spec takes :oidcc_provider_configuration_worker.opts() as parameter, which defines the :name map key as gen_server:server_name().

Current behavior

gen_server:server_name() is not a match for Elixir's GenServer.name and doesn't include a bare atom, which is transformed by Oidcc.ProviderConfiguration.Worker.start_link however.

How to reproduce

defmodule MyApp.OIDC.Provider do
  @spec child_spec(term) :: Supervisor.child_spec()
  def child_spec(_) do
    Oidcc.ProviderConfiguration.Worker.child_spec(%{
      name: __MODULE__,
      …
    })
  end
end

Add this to a project, run dialyzer, see error, e.g.:

ElixirLS Dialyzer: The function call will not succeed.

Oidcc.ProviderConfiguration.Worker.child_spec(%{:issuer => _, :name => Kasts.OIDC.GitLabProvider})

breaks the contract
(opts :: :oidcc_provider_configuration_worker.opts()) :: Supervisor.child_spec()

Expected behavior

Typespecs are correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0