708 pinned param + clet + self-import-skip after #19 landed; the other 4 sites where check_module_shadow is wired (N_MLET, N_FORRANGE single, N_FORRANGE tuple, N_MCASE) had no dedicated negative-compile row. Worker-19's note that all 6 sites use identical call shape is true today but unpinned by tests; a future asymmetric edit could silently disable enforcement on one site. Adds neg_mlet (let-tuple binder shadows), neg_forrange_single (`for shadowmod of ...`), neg_forrange_tuple (`for (shadowmod, x) of pairs`), neg_mcase (`case let shadowmod:`). Each errors at the binder decl line with the canonical "<kind> '<name>' shadows imported module '<name>'" message. 708's main now runs 8/8 (param, let, mlet, forrange_single, forrange_tuple, mcase, pos_rename, pos_selfimp).
16 lines
416 B
Plaintext
16 lines
416 B
Plaintext
// 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.
|
|
|
|
use shadowmod;
|
|
|
|
export fn main() i32 = {
|
|
let s: str = "abc";
|
|
let total: i32 = 0i32;
|
|
for (let shadowmod .. s) {
|
|
total += shadowmod: i32;
|
|
};
|
|
return total;
|
|
};
|