// #30 legal control — VALUE-BEFORE-USE order. The twin of // modfn_coexist_ok.ww with the decl order flipped: the value-namespace // `fn aa` is declared BEFORE `import aa`. cstage is order-independent // (it installs every SK_USE in a dedicated first pass, cmd/wcc/check.c // :2811+), so its value-arm promote always fires. wwstage installs in // source order, so this direction is closed by the symmetric promote in // installdecl's N_USE arm (set use_alias on the pre-installed value sym, // mirroring cmd/wcc/check.c:2823-2834). Both orders must compile clean + // be cs/ww byte-identical AND byte-identical to the use-before-value // order — the order-dependence is exactly what regresses silently. // // Both refs must resolve, so any mis-resolution fails to COMPILE: `aa()` // must bind the fn (a module is not callable), and `aa.helper()` must bind // through the module (the fn has no field `helper`). Accept proves both. package aa; export fn helper() i32 = { return 5; }; package main; fn aa() i32 = { return 1; }; import aa; export fn main() i32 = { return aa() + aa.helper(); };