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

A function body yields a type whose opacity is broken by
other clauses, or vice versa.

This is a new warning type introduced in OTP 28 as part of
the nominal types (EEP-69) rework of opaque type checking.

## Example

    defmodule OpaqueStruct do
      defstruct [:opaque]

      @opaque t :: %OpaqueStruct{}
    end

    defmodule Example do
      @spec bad_union(boolean()) :: OpaqueStruct.t()
      def bad_union(true), do: %OpaqueStruct{}
      def bad_union(false), do: OpaqueStruct.new()
    end

---

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