`ErrorsOf` — Typed Error Union (v1.39.0)

ErrorsOf<T1, T2, ...> is a discriminated union over error types. It inherits OneOfBase (same shared dispatch as OneOf) and implements IError — so it is itself a valid error usable as TError in Result<TValue, TError>.

All type slots must implement IError (where T1 : IError where T2 : IError ...).

// Implicit conversions from each Ti — no explicit wrapping needed
ErrorsOf<ValidationError, InventoryError> err = new ValidationError("Amount required");

// Exhaustive match over the active case
string message = err.Match(
    v => v.Message,
    i => i.Message);

// IError implementation delegates to the active case
Console.WriteLine(err.Message); // "Amount required"

// IsT1..T8 / AsT1..T8
if (err.IsT2) { var inv = err.AsT2; /* InventoryError */ }