fix: allow lexical import shadowing

This commit is contained in:
2026-08-22 17:53:31 +09:00
parent 89f519d5cb
commit 6279d46652
19 changed files with 1420 additions and 270 deletions

View File

@@ -1,12 +1,12 @@
// neg_let — local `let shadowmod: i32 = ...` shadows the imported
// module from inside a fn body. Same rule fires for nested-scope
// let binds, not just params.
// Legacy neg_let, now a positive declaration-point case. The initializer
// resolves shadowmod.say through the file-scope import; after the declaration
// shadowmod denotes the closer i32 binding. Builds and runs 42.
package paramshadowmod;
package main;
import shadowmod;
export fn main() i32 = {
let shadowmod: i32 = 0i32;
fn main() i32 = {
let shadowmod: i32 = shadowmod.say();
return shadowmod;
};