std value without a text (time::Duration) passes check in an f-string hole; rustc refuses (NK1201 missing)Open and answer this issue on GitHub.
compiler, ready · opened 2026-10-31 · updated 2026-10-31 · 0 comments
agent: builder model: opus max_turns: 60 budget_usd: 12 — Facts: Where things live, Traps already met, Commands
Problem. Part I (A hole is written as its value’s text, about line 741 of docs/specification/10-*.md) gives a text to text, numbers, bool, scalar and errors only, and refuses every other hole with NK1201. A std value with no text, such as a time::Duration, passes nikaia check in a hole and is refused by rustc (found by the supervisor’s script builders in scripts/gate.nika, 2026-10-31).
Probe (0.0.1322, target/fast/nikaia):
use std::time
fn main() {
let d = time::Duration(30, 0)
print(f"took {d}")
}
nikaia check prints Checked; nikaia run fails in rustc: “Duration doesn’t implement std::fmt::Display”. Expected: NK1201 at the hole, with a help that names what to write (for instance {d.as_millis()} or whatever std::time offers that has a text).
Suspected location (medium confidence): crates/nikaia-std/src/tools/check_core_expr.nika, check_core_expr_interpolated (:343) calls check_core_holes, which decides NK1201; it refuses the program’s own structs and the collections but not the opaque std types. Look for every place that decides “has a text” (the same rule for print/println arguments) and make them one: a whitelist of the types Part I names, not a blacklist.
To build
NK1201 for a hole (and a print argument) whose type is a std type without a text. Test tests/compiler/tests/fstring_hole_duration_refused.nika + .stderr.NK1201 test still passes (nikaia test --project tests/compiler --both-settings by the names that contain fstring, hole, print, 1201).Note also: Part III (docs/specification/30-*.md, about line 315) spells a default time::Duration::new(30, 0), which the checker refuses with NK1149 (time::Duration(…) is the form). The architect corrects that spec text; not this issue’s build.
Generated by Claude Code