Skip to content
docs
Arxo ↗

LDC-E2106 — A match that misses an enum case

For LLMs5 sections

A match over an enum must account for every case: each variant needs its own branch, or a wildcard branch that catches the rest. Leaving a variant uncovered is a static error — the expression would have no value for that input, and the compiler refuses to leave the gap.

Adding a branch for the missing variant, or a wildcard branch at the end, makes the match exhaustive and clears the diagnostic.

Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
enum Status { Active; Suspended; Revoked; }
relation s(x: Status) kind institutional;
relation f(a: Decimal) kind institutional;
relation done(x: Status) kind institutional;
rule R strict { for x: Status; when s(x) and f(match x { Active => 1; Suspended => 2; }); then done(x); }
Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
enum Status { Active; Suspended; Revoked; }
relation s(x: Status) kind institutional;
relation f(a: Decimal) kind institutional;
relation done(x: Status) kind institutional;
rule R strict { for x: Status; when s(x) and f(match x { Active => 1; Suspended => 2; Revoked => 3; }); then done(x); }

The engine reports this in its own wording:

Output
example.law:9:48: error LDC-E2106: non-exhaustive match on Status: ["Revoked"] are not covered — static error in core-executable (§39/§55.1)

Documentation for Arxo. Writings — blog.arxo.io.

Anonymous visit counts on stats.arxo.io, no cookies.