typecheck: bare non-negative integer literals are context-polymorphic - #1924
Merged
Conversation
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>
gHashTag
enabled auto-merge (squash)
August 8, 2026 08:36
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
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.
infer_expr pinned every integer literal to I32 -- in u32-dominant specs every
let x = 0; x = u32_expr;raised a false 'cannot assign U32 to I32', and 27 of tri-net's specs fail typecheck TODAY on exactly this (invisible until #1922 made typecheck gate). Bare non-negative literals now infer Unknown (context-polymorphic); explicitly negative literals stay I32; promote_types resolves Unknown+Known to the KNOWN operand (100 - valuewith value: u32 is u32, improving coverage rather than losing it). tri-net sweep: 27 failing -> 2 (both 'assign to immutable array element' singletons, tracked with the C tail in #1919). Unit suite 1537/1537; FROZEN_HASH resealed; NOW files updated.Closes #1923
🤖 Generated with Claude Code