LDC-E2112 — A refinement inside a variant case field
For LLMs5 sections
What it means
Section titled “What it means”Variant case fields carry a plain type and nothing more: a where
refinement on a field has no executable meaning yet, and accepting it
would pretend a check exists that never runs. The compiler rejects the
refinement at the field rather than lowering a promise it cannot keep.
Dropping the refinement and keeping the bare type is the fix. Any condition the refinement expressed belongs in a rule, where it is actually evaluated.
Example
Section titled “Example”language "law.core" version "0.2";package demo.diagnostics version "0.1.0";namespace "urn:law:demo:diagnostics";
type Identifier = Checked { value: Text where self == self; } | Anonymous;language "law.core" version "0.2";package demo.diagnostics version "0.1.0";namespace "urn:law:demo:diagnostics";
type Identifier = Checked { value: Text; } | Anonymous;Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.