typecheck: scope the W456 immutable-array-element error to const ROM arrays - #1926
Merged
Conversation
…arrays W456's intent is rejecting writes into module-level const arrays (ROM), but it keyed on is_mutable alone, so element assignment into a fn-local let-bound array -- where t27's convention is inferred mutability (scalar reassignment is a mere warning; every backend promotes to var/mut) -- raised a hard error. SymbolEntry now carries is_const (module-level const declarations only): const arrays keep the W456 error (existing unit test preserved), local let-arrays get the scalar-style promotion warning. tri-net's full-spec typecheck sweep goes 2 failing -> 0 -- the corpus is typecheck-clean for the first time. Unit suite 1537/1537; FROZEN_HASH resealed. Closes #1925 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
August 8, 2026 08:50
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.
W456's intent is rejecting writes into module-level const arrays (ROM), but it keyed on is_mutable alone -- element assignment into a fn-LOCAL let-bound array (t27's inferred-mutability convention, same as scalars) raised a hard error, and the last two tri-net specs failing typecheck hit exactly this. SymbolEntry now carries is_const: const arrays keep the ROM error (existing W456 unit test preserved), local let-arrays get the scalar-style warning. tri-net's full-corpus typecheck sweep: 2 -> 0 failing -- clean for the first time, opening the door to a full-sweep typecheck gate in tri-net CI. Unit suite 1537/1537; FROZEN_HASH resealed; NOW files updated.
Closes #1925
🤖 Generated with Claude Code