Final E2-C2 commit. New decl-namespace gate, both stages: dup fn/type/def/let build-FAIL with a right-reason "duplicate <kind> <name>" diag (shared substring; ww has no line:col); builtin_redecl ACCEPT exit 7 (shadowing a pre-seeded builtin is redeclarable); modfn coexist reshaped to a real directory package (696 precedent) via ww build --sep on two layouts (modfn_coexist + _vbu use-before-value) so both run to 6, cs==ww per-pkg .s/.wwi/.unit.ww, cross-order byte-id on .s/.wwi (.unit.ww excluded: verbatim source flips by construction, order-independence is codegen). __root.s carries both CALL aa.helper and CALL main.aa distinctly. Test-only; all 5 pins hold; 443 to 444.
12 lines
570 B
Plaintext
12 lines
570 B
Plaintext
// #30 dir-package coexistence — the value-namespace `fn aa` and the
|
|
// imported MODULE `aa` (SK_USE) coexist. `aa()` binds the local fn (a
|
|
// module is not callable); `aa.helper()` binds through the module (the
|
|
// fn has no field `helper`). Both must resolve, so any mis-resolution
|
|
// fails to COMPILE; running to 1+5=6 proves both bind. The dir-package
|
|
// reshape of the dying single-file modfn_coexist_ok.ww (M4 amalgamation
|
|
// shape retired at the flip).
|
|
package main;
|
|
import aa;
|
|
fn aa() i32 = { return 1; };
|
|
export fn main() i32 = { return aa() + aa.helper(); };
|