docs← Back to article

Markdown for LLMs

LDC-E8303 — Overlapping rows disagree under hit any

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

Download this articlePlain text ↗
# LDC-E8303 — Overlapping rows disagree under hit any

## What it means

A decision table with an any hit policy tolerates overlapping rows,
but only when the overlapping rows agree on the output: any of them
may fire, and the answer must not depend on which one does. When two
rows can both match the same input yet produce different outputs, the
answer would depend on the choice, so the compiler stops at the later
row and names both rows involved.

Giving both rows the same output — or narrowing the guards until they
no longer overlap — is the fix.

## Example

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

decision Any(x: Integer) -> Integer {
  table hit any { when x >= 1 => 7; when x >= 1 => 8; otherwise => 0; }
}
```

## Fix

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

decision Any(x: Integer) -> Integer {
  table hit any { when x == 1 => 7; when x >= 1 => 7; otherwise => 0; }
}
```

## Engine message

The engine reports this in its own wording:

```text
example.law:6:37: error LDC-E8303: decision "Any": TABLE_OUTPUT_DISAGREEMENT between overlapping rows sha256:c0aee4b01da9fdc5ef54a5eaf0cc2a81d338557c9310b7d4031a60d1c83ad526 and sha256:8131d0f12a37cb670dd46e6ae569c8ba31c019e469d5276c9bb99f1ff8dbf427 under hit any
```

## Related

- [LDC-E8301](/diagnostics/LDC-E8301/) — hit policies and row guards.