typecheck: promote call-arity mismatch from warning to hard error - #1922
Merged
Conversation
The arity check existed but only warned, and nothing reads warnings -- tri-net's specs-typecheck hook greps 'Typecheck OK' and the gen paths skip typecheck entirely, so two tri-net specs shipped wrong-arity calls for months (tri-net#323) that every backend silently mangles. Arity mismatch now sets error_count/ok=false and actually gates. Sweep evidence: zero arity violations remain across tri-net's 100+ specs post-#323, so the promotion breaks nothing (27 specs carry PRE-EXISTING unrelated typecheck errors, byte-identical under stock t27c). Unit suite 1537/1537. FROZEN_HASH resealed. Closes #1921 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
August 8, 2026 08:24
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
This was referenced Aug 8, 2026
Closed
gHashTag
added a commit
that referenced
this pull request
Aug 8, 2026
…#1924) infer_expr pinned every integer literal to I32, so in u32-dominant specs every 'let x = 0; ... x = u32_expr;' and 'metric = 100 - value' raised a false 'cannot assign U32 to I32' -- 27 of tri-net's specs failed typecheck on exactly this, invisible until #1922 made typecheck gate (the hook only checks staged files). A bare NON-NEGATIVE literal now infers Unknown (context-polymorphic); only an explicitly negative literal commits to I32; and promote_types resolves Unknown+Known to the KNOWN operand. tri-net sweep: 27 failing -> 2 (both 'assign to immutable array element' singletons, tracked with #1919). Unit suite 1537/1537; FROZEN_HASH resealed. Closes #1923 Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The arity check existed but only warned, and nothing reads warnings (tri-net's specs-typecheck hook greps 'Typecheck OK'; gen paths skip typecheck entirely) -- two tri-net specs shipped wrong-arity calls for months (tri-net#323) that every backend silently mangles. Arity mismatch now sets error_count and ok=false, so the gate actually blocks the class. Sweep: zero arity violations remain across tri-net's 100+ specs post-#323 -- the promotion breaks nothing (27 specs carry pre-existing UNRELATED typecheck errors, byte-identical under stock t27c; tracked separately). Unit suite 1537/1537; FROZEN_HASH resealed; NOW.md + docs/NOW.md updated.
Closes #1921
🤖 Generated with Claude Code