ww: finish initialization validation parity
This commit is contained in:
@@ -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 })!;
|
||||
|
||||
Reference in New Issue
Block a user