Files
ww/selfhost
Hojun-Cho 6f10c832a4 selfhost/cmd/wcc/check+test: reject bare alloc(v) at let-init in wwstage
Cstage's check.c:981-1006/1052-1082 builds a real (*T|nomem) /
([]T|nomem) return type for the alloc builtin; wwstage was returning
nil from exprtype's N_CALL arm (alloc is SK_FN with decl=nil under
seedprimitives), and checkletassign early-returned on nil src,
silently accepting `let p: *T = alloc(v);` without `!`. Stage
asymmetry that #30 papered over until now.

Three coordinated edits in check.ww:
- exprtype N_CALL: synthesize N_TTAGGED{N_TPTR{argt}, nomem} or
  {N_TSLICE{u8}, nomem} for bare alloc (same-module gated, mirrors
  cstage check.c:981-985 / task #23).
- exprtype N_TRYUNW: project the success variant so `let p:*T =
  alloc(v)!;` resolves rhs to *T.
- isassignable: tagged → non-tagged is unconditionally not
  assignable, forcing match/?/!.

950_selfcheck.c rows pin both ptr and slice forms.
2026-05-20 00:03:43 +09:00
..