opaque_nonequality.ex (762B)
1 defmodule Dialyxir.Warnings.OpaqueNonequality do 2 @behaviour Dialyxir.Warning 3 4 @impl Dialyxir.Warning 5 @spec warning() :: :opaque_neq 6 def warning(), do: :opaque_neq 7 8 @impl Dialyxir.Warning 9 @spec format_short([String.t()]) :: String.t() 10 def format_short([type, _op, opaque_type]) do 11 "Attempted to test for inequality between #{type} and opaque type #{opaque_type}." 12 end 13 14 @impl Dialyxir.Warning 15 @spec format_long([String.t()]) :: String.t() 16 def format_long([type, _op, opaque_type]) do 17 "Attempt to test for inequality between a term of type #{type} " <> 18 "and a term of opaque type #{opaque_type}." 19 end 20 21 @impl Dialyxir.Warning 22 @spec explain() :: String.t() 23 def explain() do 24 Dialyxir.Warning.default_explain() 25 end 26 end