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,17 +1,14 @@
// pos_crossmod — cur_mod-filtering positive. Replaces the abolished
// pos_selfimp (self-import is hard-rejected post-#16). This module
// (paramshadowmod) imports `shadowmod`, and the bundle also pulls module
// `crossmod`, whose probe() has a param named `shadowmod`. crossmod does
// NOT import shadowmod, so the shadow rule — filtered by the binding's
// own module — must NOT trip crossmod's param, even though a sibling
// module in the same bundle imports that leaf. Build + run; exit = 2.
// pos_crossmod — file-local import ownership control. This source imports
// shadowmod, while crossmod's separate source has a parameter of that name
// and no such import. The caller's qualifier cannot leak into the sibling
// package's lexical scope. Both stages build and run 2.
package main;
import shadowmod;
import crossmod;
export fn main() i32 = {
fn main() i32 = {
let _ = shadowmod.say();
return crossmod.probe("hi");
};