Skip to content

Safety Analyzers

Catch Result<T> and OneOf mistakes at compile time — 6 diagnostics and 3 code fixes. Install once, protect your whole codebase.

dotnet add package REslava.Result.Analyzers
  • RESL1001 — Unsafe .Value [Warning + Code Fix] Detects .Value access without an IsSuccess guard.

  • RESL1002 — Discarded Result [Warning] Warns when a Result<T> return value is silently ignored.

  • RESL1003 — Prefer Match [Info] Suggests .Match() over manual if/else when both branches use the result.

  • RESL1004 — Async Not Awaited [Warning + Code Fix] Detects Task<Result<T>> assigned without await.

  • RESL1005 — Suggest Domain Error [Info] Suggests domain-specific error types over generic new Error("...").

  • RESL1006 — Conflicting Validate Attributes [Error] Detects conflicting [Validate] and [FluentValidate] on the same type.

  • RESL2001 — Unsafe OneOf.AsT* [Warning + Code Fix] Detects .AsT1/.AsT2 access without an .IsT1/.IsT2 guard.