Markdown for LLMs
LDC-E0205 — A match arm the slice does not read
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# LDC-E0205 — A match arm the slice does not read
## 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
```law
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);
}
```
## Fix
```law
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; };
```
## Engine message
The engine reports this in its own wording:
```text
example.law:11:56: error LDC-E0205: pattern literal §55.1 outside slice 0.1: only a variant and `_` are parsed
```
## Related
- [LDC-E0204](/diagnostics/LDC-E0204/) — a let without a written type.