param-not-in-restricted-set message omits the allowed set the ledger promises #48

Closed
opened 2026-05-30 16:31:27 +02:00 by Brummel · 0 comments
Owner

Summary

design/models/0007-kernel-extensions.md:280-281 states the
diagnostic "ParamNotInRestrictedSet names the offending type and
the allowed set." The shipped message names the offending type, the
type-variable, and the home type, but not the allowed set
{Int, Float, Bool}. A downstream author is told what is wrong but
not what is right; self-correction would require reading the kernel
source, which a downstream consumer does not have.

Reproduction (verified)

ail check examples/fieldtest/rawbuf_4_paramin_reject.ail

error: [param-not-in-restricted-set] first_price: type-arg \Tick` is not in the restricted set for type-variable `a` of `raw_buf.RawBuf``

The allowed set is absent. Fires identically for the shipped Str
fixture and for a user-defined Tick ADT element.

Resolution options

  • Append the allowed set to the message (author-useful fix), or
  • Tighten the ledger to drop "and the allowed set" if it over-promised.

The former matches the ledger's stated contract.

Surfaced by the raw-buf fieldtest (finding B3), spec
docs/specs/0058-fieldtest-raw-buf.md. Commit 8e9f0f0.

## Summary `design/models/0007-kernel-extensions.md:280-281` states the diagnostic "`ParamNotInRestrictedSet` names the offending type and the allowed set." The shipped message names the offending type, the type-variable, and the home type, but not the allowed set `{Int, Float, Bool}`. A downstream author is told what is wrong but not what is right; self-correction would require reading the kernel source, which a downstream consumer does not have. ## Reproduction (verified) ``` ail check examples/fieldtest/rawbuf_4_paramin_reject.ail ``` → `error: [param-not-in-restricted-set] first_price: type-arg \`Tick\` is not in the restricted set for type-variable \`a\` of \`raw_buf.RawBuf\`` The allowed set is absent. Fires identically for the shipped `Str` fixture and for a user-defined `Tick` ADT element. ## Resolution options - Append the allowed set to the message (author-useful fix), or - Tighten the ledger to drop "and the allowed set" if it over-promised. The former matches the ledger's stated contract. Surfaced by the raw-buf fieldtest (finding B3), spec `docs/specs/0058-fieldtest-raw-buf.md`. Commit `8e9f0f0`.
Brummel added the bug label 2026-05-30 16:31:27 +02:00
Sign in to join this conversation.