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()
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 asgen_server:server_name()
.Current behavior
gen_server:server_name()
is not a match for Elixir'sGenServer.name
and doesn't include a bareatom
, which is transformed byOidcc.ProviderConfiguration.Worker.start_link
however.How to reproduce
Add this to a project, run dialyzer, see error, e.g.:
Expected behavior
Typespecs are correct.