You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
t27c: optional capture dropped, orelse unparsed, test-local reassign emitted as const, pointer param var rename #6358
Found by the t27b optionals lane (#6357), Refs #6063. Each is a t27c (parser or gen-zig) defect that makes the reference path refuse a well-formed spec:
if (x) |v| { ... } -- gen-zig drops the |v| capture; zig then reports v as undeclared. t27b refuses the shape as StmtIf(capture).
orelse does not parse in t27c.
In a test block, a plain assignment w = 9; to a name already declared with var is emitted as const w = 9;, a redeclaration zig rejects.
A mutated pointer parameter is renamed to var p = p_arg;, which zig rejects as "never mutated" when only p.* is written.
For 3 and 4, t27b currently passes such files while the reference does not compile them; they sit outside the 720 reference passes, so no count changes, but t27b should refuse them by name until the reference is fixed.
Boundary
bootstrap/src/compiler.rs
User Scenarios
Given a spec with if (x) |v| { use(v); }, when compiled by t27c, then the generated Zig must declare the capture v so the Zig compiler accepts it.
Given a spec containing orelse in an optional chain, when parsed by t27c, then the parser must accept the keyword and produce a valid AST node.
Given a test block where var w = 1; is followed by w = 9;, when codegen runs, then the reassignment must be emitted as a variable assignment, not a const redeclaration.
Given a function taking a pointer parameter p: *i32 that mutates p.*, when codegen renames the parameter, then the generated Zig must not emit var p = p_arg; if only p.* is written.
Requirements
FR-001: The gen-zig backend MUST emit a capture variable for optional if patterns so the Zig compiler sees the declared name.
FR-002: The parser MUST recognize orelse as a valid keyword in optional expressions and produce a corresponding AST node.
FR-003: In test blocks, assignments to already-declared var names MUST be emitted as mutable assignments, not const redeclarations.
FR-004: When a pointer parameter is only mutated through dereference (p.*), the codegen MUST NOT emit a var p = p_arg; shadow that Zig flags as never mutated.
Success Criteria
cargo test -p t27c -- optional_capture exits 0 and the generated Zig for if (x) |v| {} compiles without "undeclared identifier" errors.
cargo test -p t27c -- orelse_parse exits 0 and a spec containing orelse parses without syntax errors.
cargo test -p t27c -- test_reassign_const exits 0 and the emitted Zig for w = 9; inside a test block compiles without "redeclaration" errors.
cargo test -p t27c -- ptr_param_rename exits 0 and the emitted Zig for a mutated pointer parameter compiles without "never mutated" errors.
All 720 reference specs in specs/tools/tri/test.t27 still pass (t27c exit 0).
An attempt claimed this issue on 2026-10-06 and left an empty branch. A dispatch row that has spent its retry ceiling is released once and then keeps its issue for good, which is the right rule for a third identical failure and the wrong outcome for an issue nobody ever attempted twice. The new issue carries the same work, the same boundary, and today's brief.
Closing this one so the swarm can take the work again.
Activity
fix(specs): restore set, lru and lru_cache from their .tri sources
github-actions commentedon Oct 9, 2026
Re-filed as #8199.
An attempt claimed this issue on 2026-10-06 and left an empty branch. A dispatch row that has spent its retry ceiling is released once and then keeps its issue for good, which is the right rule for a third identical failure and the wrong outcome for an issue nobody ever attempted twice. The new issue carries the same work, the same boundary, and today's brief.
Closing this one so the swarm can take the work again.