Open sandboxFocusImprove this doc

Contracts errors and warnings

Diagnostics reported by Metalama.Patterns.Contracts.

Article Description
LAMA5001: The type can't satisfy the range of the contract A range contract is applied to a declaration whose numeric type can't hold any value of the range.
LAMA5002: A non-nullable contract is applied to a nullable type A [NotNull] or [Required] contract is applied to a declaration of nullable type.
LAMA5003: The non-nullable contract is redundant An explicit [NotNull] or [Required] contract is redundant because a fabric already adds [NotNull].
LAMA5004: Invariant suspension isn't enabled for the type The [SuspendInvariants] aspect is used without enabling invariant suspension for the type.
LAMA5005: Invariant suspension is redundant on a type without invariants A method is marked with [SuspendInvariants], but its declaring type has no invariants.
LAMA5006: The range contract is redundant for the type of the declaration A range contract is redundant because the type of the target always satisfies the range.
LAMA5007: The strictness of the inequality contract is ambiguous An inequality contract such as [Positive] is used without specifying whether the inequality is strict.