test: remove package-wide import assumptions

This commit is contained in:
2026-08-14 03:45:02 +09:00
parent a841278333
commit 04d9560d51
74 changed files with 121 additions and 154 deletions

View File

@@ -1,5 +1,4 @@
// #30 dir-package — the imported module `aa`. Paired with ../main.ww,
// whose primary package also declares a value-namespace `fn aa`. Driver:
// the modfn_coexist leg of the decl-namespace gate (NNN_declns_sep.c).
// #30 dir-package — the imported package whose declared name supplies the
// `aa` binding in ../main.ww. Driver: the declns leg of sepimport_test.
package aa;
export fn helper() i32 = { return 5; };

View File

@@ -1,11 +1,8 @@
// #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).
// The imported default qualifier `aa` and package-level declarations occupy
// overlapping Go-style scopes, so the local function deliberately has a
// distinct name. Running to 1+5=6 proves both the local declaration and the
// file-scoped import binding resolve independently.
package main;
import aa;
fn aa() i32 = { return 1; };
export fn main() i32 = { return aa() + aa.helper(); };
fn localaa() i32 = { return 1; };
export fn main() i32 = { return localaa() + aa.helper(); };