Dialyxir.Warnings.NegativeGuardFail (Dialyxir v1.4.8)

Copy Markdown View Source

The function guard either presents an impossible guard or the only calls will never succeed against the guards.

Example

defmodule Example do
  def ok(ok = "ok") when not is_bitstring(ok) do
    :ok
  end
end

or

defmodule Example do
  def ok() do
    ok(:ok)
  end

  defp ok(ok) when not is_atom(ok) do
    :ok
  end
end