Resl2002 Errorsof.Match Not Exhaustive Warning
title: RESL2002 — ErrorsOf.Match() Not Exhaustive [Warning]
Warns when ErrorsOf<T1..Tn>.Match() receives fewer handler lambdas than the union has type arguments.
// Assuming ErrorsOf<ValidationError, NotFoundError, ConflictError>
// ⚠️ RESL2002: Match() provides 2 handler(s) but the union has 3 type(s)
result.Error.Match(
v => HandleValidation(v),
n => HandleNotFound(n)
// ConflictError handler missing — will throw InvalidOperationException at runtime
);
// ✅ exhaustive — all 3 handlers provided
result.Error.Match(
v => HandleValidation(v),
n => HandleNotFound(n),
c => HandleConflict(c)
);