LDC-E0205 — A match arm the slice does not read
What it means
Section titled “What it means”A match chooses a value by the shape of a subject: each arm names a shape
and the value for it. The current slice reads two shapes — a variant name
and the catch-all underscore. A literal number or string as an arm, a
constructor with field bindings, a qualified name: all three are grammar the
slice does not parse yet, so the arm is refused at the pattern.
The refusal is about the arm’s shape, not the subject or the arm’s value.
Rewrite the arm with a variant or the underscore. If the decision truly
depends on a number, lift the comparison out of the match into the rule
body, where comparisons belong — or move the whole decision table into a
function, where a match over the slice shapes is at home.
Example
Section titled “Example”language "law.core" version "0.2";package demo.diagnostics version "0.1.0";namespace "urn:law:demo:diagnostics";
entity A;relation p(a: A) kind institutional;relation q(n: Integer) kind institutional;rule R strict { for a: A; for n: Integer; when p(a) and q(n) and (let m: Integer = match n { 1 => 2; _ => 3 } in m) = 2; then p(a);}language "law.core" version "0.2";package demo.diagnostics version "0.1.0";namespace "urn:law:demo:diagnostics";
function pick(n: Integer) -> Integer = match n { _ => 3; };Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.