Render param-not-in-restricted-set allowed set in AILang syntax, not Rust debug #52
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The
param-not-in-restricted-setdiagnostic renders the allowed element set as a Rust debug list rather than AILang type syntax. An author reading the message sees Rust formatting leaking into a language-level diagnostic.Reproduction (verified, current HEAD)
A
RawBufwith a forbidden element type in a fn signature position:ail check->The set renders as
["Bool", "Float", "Int"]— a{:?}debug print of a sorted Rust collection (note the quotes, brackets, and alphabetical order). The author-facing form would be AILang type names, e.g.{Int, Float, Bool}orInt | Float | Bool.Where
The message was added in the B3 fix (issue #48) on
CheckError::ParamNotInRestrictedSet(crates/ailang-check/src/lib.rs, the#[error]attribute, ~line 749). The(allowed: one of {allowed:?})interpolation uses the debug formatter on the allowed-set collection.Impact
Cosmetic / diagnostic quality. The diagnostic is correct and fires at the right place; only the rendering of the set is Rust-shaped rather than AILang-shaped. AILang's audience is an LLM author, so diagnostic surface that reads as the target language matters.
Acceptance