CI root: https://github.com/zig-utils/zig-js/actions/runs/29693769324/job/88210905183
Parent: #267
Related: #298
Roadmap: #142, #268, #134
Root cause and implementation
The canonical recursive type identity test expected ref.cast between unrelated concrete struct types to be invalid. Under the pinned GC validation rule, ref.cast rt may consume any valid supertype of rt; the prior program was therefore valid and could trap dynamically. It did not isolate canonical identity.
Commit 62ead6c8 uses struct.get type 1, field 0 instead. The operation accepts the produced type-0 reference only when the separately declared recursive groups are canonically equivalent. The structurally distinct group fails at that exact instruction with type mismatch.
Acceptance
CI root: https://github.com/zig-utils/zig-js/actions/runs/29693769324/job/88210905183
Parent: #267
Related: #298
Roadmap: #142, #268, #134
Root cause and implementation
The canonical recursive type identity test expected
ref.castbetween unrelated concrete struct types to be invalid. Under the pinned GC validation rule,ref.cast rtmay consume any valid supertype ofrt; the prior program was therefore valid and could trap dynamically. It did not isolate canonical identity.Commit
62ead6c8usesstruct.get type 1, field 0instead. The operation accepts the produced type-0 reference only when the separately declared recursive groups are canonically equivalent. The structurally distinct group fails at that exact instruction withtype mismatch.Acceptance
type mismatchdiagnostic.