ww: finish initialization validation parity

This commit is contained in:
2026-08-14 20:03:11 +09:00
parent 25da54936d
commit c59a7c11de
26 changed files with 528 additions and 143 deletions

View File

@@ -1,10 +1,6 @@
//ww:error "runtime initializer unsupported (alloc/call; rule 7)"
// Module-scope alloc initializer: no DATAW slot exists for a
// runtime-computed global, so pre-reject every reference died at
// LINK time ("undefined reference to 'main.gp'") — the checker now
// rejects at the declaration on both frontends (Hare model:
// ref/harec/src/check.c:4360 rejects non-compile-time-evaluable
// global initializers; ww has no @init path).
//ww:run
// A module-scope allocation is evaluated once by the package task before
// main; its pointer remains live in the zero-backed package variable.
package main;
type box = struct { s: str, n: int };
let gp = alloc(box { s = "hi", n = 1 })!;