Markdown for LLMs
LDC-E1326 — Map over a non-enum domain
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# LDC-E1326 — Map over a non-enum domain
## What it means
A map proves totality over declared membership: both ends must be
enumerations of the package, so every member is known and every row
lands somewhere. A domain or codomain that is not a package enum —
an entity, a type alias, anything else — gives the map no membership
to be total over, and the compiler stops at the offending end.
The repair is to declare the enumeration, or to point the map at one
that exists. Rows that name non-members, or the same member twice, are
refused by the same check once the ends resolve.
## Example
```law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
enum Harmony {
Zhuan;
Zhinishke;
}
entity Tenant;
map broken_map: Tenant -> Harmony {
Zhuan => Zhuan;
}
```
## Fix
```law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
enum Harmony {
Zhuan;
Zhinishke;
}
map full_map: Harmony -> Harmony {
Zhuan => Zhuan;
Zhinishke => Zhinishke;
}
```
## Engine message
The engine reports this in its own wording:
```text
example.law:10:17: error LDC-E1326: map "broken_map": domain "Tenant" is not an enum of this package; totality is proven over the declared membership, and the §23 import context does not carry a foreign package's membership (§46.1)
```
## Related
- [Vocabulary](/constructs/vocabulary/) — how names are declared and which positions take them.