Dialyxir.Warnings.MissingRange (Dialyxir v1.4.3) View Source

Function spec declares a list of types, but function returns value outside stated range.

This error only appears with the :overspecs flag.

Example

defmodule Example do
  @spec foo(any()) :: :ok
  def foo(:ok) do
    :ok
  end

  def foo(_) do
    :error
  end
end