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
Gate-flip regression: basic HashMap usage fails with spurious "unknown type 'T'" in embedded std (test mode, not check-only) #572
Found while fixing §3.8 test-corpus violations for #564, using the flipped-gate staged compiler (out/stage/bin/with-stage2, tree at 00422da4 + staged build).
The spurious "unknown type 'T'" diagnostics previously believed to be check-only artifacts also occur under with test, and the trigger is as small as the most basic HashMap usage:
fn main:
let m = HashMap[str, i32].new()
m.insert("a", 1)
print(int_to_string(m.len()))
$ out/stage/bin/with-stage2 test repro.w
error: unknown type 'T'
--> <embedded-std>/std/collections.w:21:22
21 | var out: Vec[T] = Vec.new()
error: unknown type 'T'
--> <embedded-std>/std/collections.w:47:49
47 | impl[T] Eq for Handle[T]: fn eq(self: Handle[T], other:
...
error: test build failed
The pre-flip installed compiler passes the same file. A second trigger shape needs no HashMap in the test file at all: importing issue61_queries.receivers + issue61_queries.samples together makes test/behavior/lib/issue61_queries/generic.w's Cell.wrap(value: T) / Cell.get(self: Cell[T]) fail with the same "unknown type 'T'" (each module compiles fine in other combinations). A signature containing &HashMap[str, i32] is a third trigger.
Expected: generic decls in std/collections.w and sibling modules typecheck as before; HashMap usable.
Actual: spurious "unknown type 'T'" build failures.
Known-blocked positive tests (all pass with the pre-flip compiler, all §3.8 violations in them already fixed):
Fixed in 1f9ec56. Two independent triggers, both latent miscompiles in the stage that built the flipped compiler, not the gate itself: (1) the DiagnosticList Copy-handle conversion (now #576) — reverted; Zcu.init reads the list back through sema_seed.diags to satisfy §3.8; (2) lower_module returning Sema by value in a struct (now #577) — replaced with the MirLowerSemaBox field-place shape. The HashMap repro and all previously blocked issue61/hashmap/comptime tests pass on the landed commit.
Activity
ehartford commentedon Jun 12, 2026
Fixed in 1f9ec56. Two independent triggers, both latent miscompiles in the stage that built the flipped compiler, not the gate itself: (1) the DiagnosticList Copy-handle conversion (now #576) — reverted; Zcu.init reads the list back through sema_seed.diags to satisfy §3.8; (2) lower_module returning Sema by value in a struct (now #577) — replaced with the MirLowerSemaBox field-place shape. The HashMap repro and all previously blocked issue61/hashmap/comptime tests pass on the landed commit.