# `Dialyxir.Warnings.OpaqueCompare`
[🔗](https://github.com/jeremyjh/dialyxir/blob/1.4.8/lib/dialyxir/warnings/opaque_compare.ex#L1)

Attempt to test for equality or inequality between a term and an
opaque type.

This warning replaces the separate `:opaque_eq` and `:opaque_neq`
warnings starting in OTP 28.

## Example

    defmodule OpaqueStruct do
      defstruct [:opaque]

      @opaque t :: %OpaqueStruct{}
    end

    defmodule Example do
      @spec bad_compare(OpaqueStruct.t()) :: boolean()
      def bad_compare(opaque) do
        opaque == %OpaqueStruct{}
      end
    end

---

*Consult [api-reference.md](api-reference.md) for complete listing*
