docs← Back to article

Markdown for LLMs

LDC-E2121 — A wrong parameter count on a parametric type

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# LDC-E2121 — A wrong parameter count on a parametric type

## What it means

Some type names take parameters, and each of them takes a fixed number:
one element type for a list or an option, two for a map, and so on. The
closed table of parametric names and their counts is part of the language,
so a count that does not match the table cannot mean anything the compiler
could keep. The compiler stops at the type expression and names the shape
it expected.

The fix stays inside the type expression: add the missing parameter or
drop the extra one until the count matches the table. A name outside the
table takes no parameter at all and is refused under a different code.

## Example

```law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";

entity KZT;
relation r(x: Option<Integer, Text>) kind empirical;
```

## Fix

```law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";

entity KZT;
relation r(x: Option<Integer>) kind empirical;
```

## Engine message

The engine reports this in its own wording:

```text
example.law:6:15: error LDC-E2121: type `Option` takes 1 parameter(s) — the §35 table prints `Option<T>`, got 2 (errata E-0201). The list of parametric std names and each one's parameter count are closed by §35 and grow only via errata; on a std name OUTSIDE this list a parameter is rejected under its own code (errata E-0194). Before E-0201 an extra or missing parameter was lowered into the type node `args` and checked by nothing
```

## Related

- [Vocabulary](/constructs/vocabulary/) — how names are declared and which positions take them.