Markdown for LLMs
LDC-E2112 — A refinement inside a variant case field
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# LDC-E2112 — A refinement inside a variant case field
## 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
```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;
```
## Fix
```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;
```
## Engine message
The engine reports this in its own wording:
```text
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)
```
## Related
- [Vocabulary](/constructs/vocabulary/) — how variant types declare their cases.