Files
ww/test/wcc/data/forrange_dup_binder_reject/case.ww
Hojun-Cho 999b110001 wcc: forrange bindings get a per-loop scope; dup binders reject
The TODO(#11) silent-accept of `for (let (a, a) .. xs)` rested on a
stale premise -- resolvewalk has per-block scopes since #53 and IS
the live w6c_ww checker pass. Bindings now install in a per-LOOP
scope (the N_MCASE pattern), so a duplicate name within one pattern
errs "redeclared in same scope" (cstage parity via stamptuplebinds'
scopedefine-nil check) while sequential same-name loops stay legal.
kwtab restores its stated alphabetical order (`import` before `is`,
both stages, kinds swapped in lockstep with names).
2026-08-09 01:59:33 +09:00

12 lines
398 B
Plaintext

//ww:error "redeclared in same scope"
// A duplicate name within one destructure pattern; the old TODO(#11)
// silent-accept rested on a stale premise (resolvewalk has block
// scopes since #53). Bindings live in a per-LOOP scope, so sequential
// same-name loops stay legal.
package main;
export fn main() i32 = {
let s: [](i64, i64) = alloc([], 1u64)!;
for (let (a, a) .. s) { };
return 0;
};