fix: allow lexical import shadowing
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
// neg_forrange_single — `for (let shadowmod .. s)` single-binding
|
||||
// range loop where the loop variable shadows the imported module.
|
||||
// N_FORRANGE wires check_module_shadow on the single-name branch
|
||||
// (n->str), so the rule fires at the for header.
|
||||
// Legacy neg_forrange_single, now a positive range-binding case. The import
|
||||
// initializes total; the one-byte "A" iteration binds the closer shadowmod
|
||||
// value in the loop body. Builds and runs 42 + 65 = 107.
|
||||
|
||||
package paramshadowmod;
|
||||
package main;
|
||||
|
||||
import shadowmod;
|
||||
|
||||
export fn main() i32 = {
|
||||
let s: str = "abc";
|
||||
let total: i32 = 0i32;
|
||||
fn main() i32 = {
|
||||
let s: str = "A";
|
||||
let total: i32 = shadowmod.say();
|
||||
for (let shadowmod .. s) {
|
||||
total += shadowmod: i32;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user