diff --git a/lib/ww/typ.ww b/lib/ww/typ.ww index 0676bbaf..ab79a658 100644 --- a/lib/ww/typ.ww +++ b/lib/ww/typ.ww @@ -136,6 +136,18 @@ type tinfo = struct { // still lives at slotsize()'s read site; // graduating it here would break `[N]i32` // stride (4*N stays natural). + module: str, // #10 P0: defining module of a TY_NAMED, the + // declaring `// MODULE: foo` (node.nmod) where + // `type foo = …` lives — NOT the importing + // referrer. With `name` it forms the (module, + // name) intern key that re-keys the canonical- + // NAMED cache off the per-module sym, so one + // nominal type yields one tinfo pointer across + // modules (typeeq's NAMED arm is pure ptr-id). + // Mirrors harec alias.ident (type_store.c:737). + // "" for primitives + builtins + every non- + // NAMED tinfo (consulted only by the NAMED + // intern path). P0 sets the field; P1 keys on it. }; // #61 audit §1.8 / Rob+Drew convergence 2026-05-20: memoizes @@ -185,7 +197,7 @@ type tctx = struct { // ---- constructors ----------------------------------------------------- export fn newtype(k: tykind) *tinfo = { - let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64})!; + let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64, module=""})!; return t; }; diff --git a/selfhost/cmd/w6c/main.combined.ww b/selfhost/cmd/w6c/main.combined.ww index 86763636..bd76e6e6 100644 --- a/selfhost/cmd/w6c/main.combined.ww +++ b/selfhost/cmd/w6c/main.combined.ww @@ -9378,6 +9378,18 @@ type tinfo = struct { // still lives at slotsize()'s read site; // graduating it here would break `[N]i32` // stride (4*N stays natural). + module: str, // #10 P0: defining module of a TY_NAMED, the + // declaring `// MODULE: foo` (node.nmod) where + // `type foo = …` lives — NOT the importing + // referrer. With `name` it forms the (module, + // name) intern key that re-keys the canonical- + // NAMED cache off the per-module sym, so one + // nominal type yields one tinfo pointer across + // modules (typeeq's NAMED arm is pure ptr-id). + // Mirrors harec alias.ident (type_store.c:737). + // "" for primitives + builtins + every non- + // NAMED tinfo (consulted only by the NAMED + // intern path). P0 sets the field; P1 keys on it. }; // #61 audit §1.8 / Rob+Drew convergence 2026-05-20: memoizes @@ -9427,7 +9439,7 @@ type tctx = struct { // ---- constructors ----------------------------------------------------- export fn newtype(k: tykind) *tinfo = { - let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64})!; + let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64, module=""})!; return t; }; diff --git a/selfhost/cmd/wwdump/main.combined.ww b/selfhost/cmd/wwdump/main.combined.ww index 62d3d102..a173d950 100644 --- a/selfhost/cmd/wwdump/main.combined.ww +++ b/selfhost/cmd/wwdump/main.combined.ww @@ -9378,6 +9378,18 @@ type tinfo = struct { // still lives at slotsize()'s read site; // graduating it here would break `[N]i32` // stride (4*N stays natural). + module: str, // #10 P0: defining module of a TY_NAMED, the + // declaring `// MODULE: foo` (node.nmod) where + // `type foo = …` lives — NOT the importing + // referrer. With `name` it forms the (module, + // name) intern key that re-keys the canonical- + // NAMED cache off the per-module sym, so one + // nominal type yields one tinfo pointer across + // modules (typeeq's NAMED arm is pure ptr-id). + // Mirrors harec alias.ident (type_store.c:737). + // "" for primitives + builtins + every non- + // NAMED tinfo (consulted only by the NAMED + // intern path). P0 sets the field; P1 keys on it. }; // #61 audit §1.8 / Rob+Drew convergence 2026-05-20: memoizes @@ -9427,7 +9439,7 @@ type tctx = struct { // ---- constructors ----------------------------------------------------- export fn newtype(k: tykind) *tinfo = { - let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64})!; + let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64, module=""})!; return t; };