Dialyxir.Warnings.CallbackNotExported (Dialyxir v1.4.4) View Source

Module implements a behaviour, but does not export some of its callbacks.

Example

defmodule Example do
  @behaviour GenServer

  def init(_) do
    :ok
  end

  # OK. No warning.
  def handle_all(_request, _from, state) do
    {:noreply, state}
  end

  # Not exported. Should be a warning.
  @spec handle_cast(any(), any()) :: binary()
  defp handle_cast(_request, _state) do
    "abc"
  end

  # Not exported and conflicting arguments and return value. No warning
  # since format_status/1 is an optional callback.
  @spec format_status(binary()) :: binary()
  def format_status(bin) when is_binary(bin) do
    bin
  end
end