Files
ww/selfhost
Hojun-Cho c564d7d0fd selfhost/cmd/wcc: stamp e.type_ for N_SLICE (A.6.2.0a)
Port head-only of cstage cmd/wcc/check.c:1214-1228 to exprtype's
new N_SLICE arm. Four base shapes:

  - N_TARRAY → synthesize N_TSLICE{lhs=elem} (cstage L1219).
  - N_TSLICE → return basetn (pre-peel, matches cstage `base`
    not `u`; L1221).
  - N_TNAME("str") → mktname("str") (matches cstage's `ty_str`
    canonical singleton, L1223).
  - N_TPTR with non-nil sub → synthesize N_TSLICE{lhs=sub}
    (L1225, Hare-faithful slice-of-elem from pointer-to-elem).

Slice bounds (e.rhs start, e.cond end) are already walked by
resolvewalk L406-408 + post-order dispatch L460-489 — typical
N_INTLIT/N_IDENT/N_BIN are in the dispatch list; this arm does
not double-walk.

One documented divergence from cstage: lenient on non-sliceable
base (cstage L1227 errs; wwstage returns nil under the established
scruttype L656 / A.6.1.5b N_DOT struct-miss precedent).

A.6.2 step 1 of 8 (γ scope per Drew, 2026-05-21) — gap-sweep
per-kind first, post-checker assertion last. Order by triviality:
N_SLICE → N_TUPLE → N_ALLOC → N_RECV → N_SPREAD → N_YIELD →
N_MATCH → assertion. Each commit holds invariant; cgen readers
migrate in A.6.3.

Verified 132/132 incl. 995_self_rebuild byte-identity.
2026-05-21 20:16:24 +09:00
..