Markdown for LLMs
LDC-E2104 — An argument of the wrong type
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# LDC-E2104 — An argument of the wrong type
## What it means
Each argument must fit the parameter it fills: an entity argument must
be of the declared type or one of its subtypes, and a value must be of
the declared kind. The language performs no silent conversions — a
broader type never flows into a narrower parameter, and a value of one
kind never stands in for another.
Pass a value of the expected type, or widen the parameter to accept
what the rule actually supplies. Subtyping runs one way: a parameter
typed with a base entity accepts its subtypes, never the reverse.
## Example
```law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
entity Walker;
entity Runner : Walker;
relation walks(p: Runner) kind institutional;
relation strolls(a: Walker) kind institutional;
rule R strict { for a: Walker; when strolls(a); then walks(a); }
```
## Fix
```law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
entity Walker;
entity Runner : Walker;
relation walks(p: Runner) kind institutional;
relation strolls(a: Walker) kind institutional;
rule R strict { for r: Runner; when strolls(r); then walks(r); }
```
## Engine message
The engine reports this in its own wording:
```text
example.law:9:60: error LDC-E2104: walks: argument "a" has type Local("Walker"), parameter "p" expects Local("Runner") (§48: no implicit conversions)
```
## Related
- [Vocabulary](/constructs/vocabulary/) — how parameters declare their types.