LDC-E2106 — A match that misses an enum case
For LLMs5 sections
What it means
Section titled “What it means”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.
Example
Section titled “Example”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); }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); }Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.