ww imports: require imports before declarations

This commit is contained in:
2026-08-21 19:20:52 +09:00
parent b03bbb1428
commit ee4573bf55
9 changed files with 730 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
// Declaration-before-import twin of ../modfn_coexist/main.ww. The distinct
// local name follows Go's import/package-scope collision rule while retaining
// the order-independence check for installing a real import binding.
// Reordered-source twin of ../modfn_coexist/main.ww. The distinct local name
// follows Go's import/package-scope collision rule while retaining the
// declaration/import installation-order check for a real file-scoped binding.
package main;
fn localaa() i32 = { return 1; };
import aa;
fn localaa() i32 = { return 1; };
export fn main() i32 = { return localaa() + aa.helper(); };