ElixirLS Dialyzer - type mismatch for callback

defmodule Econtact.SendersCache do
  use GenServer

  def start_link(opts) do
    GenServer.start_link(__MODULE__, opts, name: __MODULE__)
  end

  def init(opts) do
    {:ok, opts}
  end
end

The above generates the below warning in VSCodium; stripped down version of VSCode

Type mismatch for @callback init/1 in GenServer behaviour.

Expected type:

:ignore
| {:ok, _}
| {:stop, _}
| {:ok, _, :hibernate | :infinity | non_neg_integer() | {:continue, _}}

Actual type:
nil

is ElixirLS broken in this case or I’m actually doing something wrong?

Thank you.

It is probably due to fact that there is stale module information. So it is probably bug in ElixirLS.

1 Like