diff --git a/NOW.md b/NOW.md index e71b104fb5..bee96426c3 100644 --- a/NOW.md +++ b/NOW.md @@ -2,6 +2,13 @@ Last updated: 2026-08-08 +## typecheck: promote call-arity mismatch from warning to hard error (Closes #1921) + +- The arity check existed but only warned, and nothing reads warnings (tri-net's hook greps 'Typecheck OK'; gen paths skip typecheck) -- two tri-net specs shipped wrong-arity calls for months (tri-net#323) +- Now: error_count += 1, ok = false -- the specs-typecheck gate actually blocks the class +- Sweep: zero arity violations remain across tri-net's 100+ specs post-#323, so the promotion breaks nothing (27 specs have PRE-EXISTING unrelated typecheck errors, identical under stock t27c) +- Unit suite 1537/1537; FROZEN_HASH resealed + ## fix(gen-c): [T;N] params, test-block bindings, t27_assert macro (Refs #1919) - Rust-style `[T; N]` parameter types now lower to `T*` (previously emitted a bare `* name` -- no base type) diff --git a/bootstrap/src/compiler.rs b/bootstrap/src/compiler.rs index 6f1cee6cea..b7da330eeb 100644 --- a/bootstrap/src/compiler.rs +++ b/bootstrap/src/compiler.rs @@ -12713,7 +12713,12 @@ fn check_expr(node: &Node, symbols: &[SymbolEntry], fns: &[FnEntry], result: &mu .filter(|c| c.kind != NodeKind::Module) .collect(); if call_args.len() != fn_entry.params.len() { - result.warnings += 1; + // Arity mismatch is a HARD error: two tri-net specs shipped + // mismatched calls for months because this only warned and + // nothing reads warnings (tri-net#323). Wrong-arity calls + // mangle in every backend. + result.error_count += 1; + result.ok = false; result.errors.push(format!( "function '{}' expects {} args, got {} at line {}", node.name, diff --git a/bootstrap/stage0/FROZEN_HASH b/bootstrap/stage0/FROZEN_HASH index 8d524157af..4cef74bcaf 100644 --- a/bootstrap/stage0/FROZEN_HASH +++ b/bootstrap/stage0/FROZEN_HASH @@ -1 +1 @@ -409ab06144271d348b7ffdb0332a032c13928984f21c8fc0f838df5ecd6caa28 +8770de8b22dfda24d5c4099b2610c4a5a6efd49e43a19e335f08eeb09f788743 diff --git a/docs/NOW.md b/docs/NOW.md index c7fec87592..d55e1f0b5c 100644 --- a/docs/NOW.md +++ b/docs/NOW.md @@ -1,7 +1,14 @@ -# NOW — fix(gen-c): params, test bindings, assert macro (2026-08-08) +# NOW — typecheck: arity mismatch is a hard error (2026-08-08) Last updated: 2026-08-08 +## typecheck: promote call-arity mismatch from warning to hard error (Closes #1921) + +- The arity check existed but only warned, and nothing reads warnings (tri-net's hook greps 'Typecheck OK'; gen paths skip typecheck) -- two tri-net specs shipped wrong-arity calls for months (tri-net#323) +- Now: error_count += 1, ok = false -- the specs-typecheck gate actually blocks the class +- Sweep: zero arity violations remain across tri-net's 100+ specs post-#323, so the promotion breaks nothing (27 specs have PRE-EXISTING unrelated typecheck errors, identical under stock t27c) +- Unit suite 1537/1537; FROZEN_HASH resealed + ## fix(gen-c): [T;N] params, test-block bindings, t27_assert macro (Refs #1919) - Rust-style `[T; N]` parameter types now lower to `T*` (previously emitted a bare `* name` -- no base type)