September 26, 2016 [Issue 16548] New: Shadowing a variable not detected when nesting foreach with associative arrays | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16548 Issue ID: 16548 Summary: Shadowing a variable not detected when nesting foreach with associative arrays Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: skocznymr@gmail.com Reproduces on git HEAD. This code: void main() { int[int] x; foreach (int a; x) { foreach (int a; x) { } } } should generate a compile error "variable a is shadowing variable a", but it doesn't. When using non-associative arrays, the error is generated properly. -- |
Copyright © 1999-2021 by the D Language Foundation