docs← Back to article

Markdown for LLMs

LDC-E2111 — A constant whose value has the wrong kind

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

Download this articlePlain text ↗
# LDC-E2111 — A constant whose value has the wrong kind

## What it means

A constant promises a type and must deliver it: the declared type and
the kind of the initializer are compared, and a mismatch is rejected
at the declaration. An integer never initializes a date, and text never
initializes a number — the promise is taken literally.

Changing the declared type to the one the value actually has, or
rewriting the value in the declared type, clears it. The message names
both sides, so the wrong one is easy to spot.

## Example

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

const Founded: Date = 2026;
```

## Fix

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

const Founded: Date = @2026-01-01;
```

## Engine message

The engine reports this in its own wording:

```text
example.law:5:7: error LDC-E2111: constant Founded: declared type Date, initializer yields Integer (§54/§48)
```

## Related

- [Vocabulary](/constructs/vocabulary/) — how declared types are written.
- [Expressions and quantities](/constructs/expressions-quantities/) — which values have which kinds.