diff --git a/cmd/wcc/type.c b/cmd/wcc/type.c index ebafc41d..671118d4 100644 --- a/cmd/wcc/type.c +++ b/cmd/wcc/type.c @@ -64,6 +64,7 @@ typesinit(Arena *a) * Size sourced from the slice SSoT (type_slice) so str and []u8 can * never drift; no second hardcoded 24. */ ty_str = prim(a, TY_STR, "str", type_slice(a, ty_u8)->size, 8); + ty_str->sub = ty_u8; /* str IS []u8: element is u8 (Phase 2 F1) */ ty_err = prim(a, TY_ERR, "", 0, 1); ty_never = prim(a, TY_NEVER, "never", 0, 1); /* #29: predeclared `type nomem = !void;`. NAMED so variant_match diff --git a/lib/ww/typ.ww b/lib/ww/typ.ww index ad492bbc..60096c80 100644 --- a/lib/ww/typ.ww +++ b/lib/ww/typ.ww @@ -219,6 +219,7 @@ export fn typesinit(c: *tctx) void = { // cgdot mirror); retained here as a local until that lands. let u8slice: *tinfo = typeslice(c.tyu8); c.tystr = prim(tykind.TY_STR, "str", u8slice.size, 8u64); + c.tystr.sub = c.tyu8; // str IS []u8: element is u8 (Phase 2 F1) c.tyerr = prim(tykind.TY_ERR, "", 0u64, 1u64); c.tynever = prim(tykind.TY_NEVER, "never", 0u64, 1u64); diff --git a/selfhost/cmd/w6c/main.combined.ww b/selfhost/cmd/w6c/main.combined.ww index 23723cd3..0c2e6ed6 100644 --- a/selfhost/cmd/w6c/main.combined.ww +++ b/selfhost/cmd/w6c/main.combined.ww @@ -6549,6 +6549,7 @@ export fn typesinit(c: *tctx) void = { // cgdot mirror); retained here as a local until that lands. let u8slice: *tinfo = typeslice(c.tyu8); c.tystr = prim(tykind.TY_STR, "str", u8slice.size, 8u64); + c.tystr.sub = c.tyu8; // str IS []u8: element is u8 (Phase 2 F1) c.tyerr = prim(tykind.TY_ERR, "", 0u64, 1u64); c.tynever = prim(tykind.TY_NEVER, "never", 0u64, 1u64); diff --git a/selfhost/cmd/wwdump/main.combined.ww b/selfhost/cmd/wwdump/main.combined.ww index e067c071..b94eab57 100644 --- a/selfhost/cmd/wwdump/main.combined.ww +++ b/selfhost/cmd/wwdump/main.combined.ww @@ -6549,6 +6549,7 @@ export fn typesinit(c: *tctx) void = { // cgdot mirror); retained here as a local until that lands. let u8slice: *tinfo = typeslice(c.tyu8); c.tystr = prim(tykind.TY_STR, "str", u8slice.size, 8u64); + c.tystr.sub = c.tyu8; // str IS []u8: element is u8 (Phase 2 F1) c.tyerr = prim(tykind.TY_ERR, "", 0u64, 1u64); c.tynever = prim(tykind.TY_NEVER, "never", 0u64, 1u64);