Skip to content
docs
Arxo ↗

LDC-E2112 — A refinement inside a variant case field

For LLMs5 sections

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.

Arxo Law
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;
Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
type Identifier = Checked { value: Text; } | Anonymous;

The engine reports this in its own wording:

Output
example.law:5:29: error LDC-E2112: variant type "Identifier", case "Checked", field "value": refinement `where` is not yet supported in M1 — there is no executable typed binding (§39/§41)

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

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