| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/fail110.d(19): Error: variable `i` is shadowing variable `fail110.main.i` |
| 5 |
fail_compilation/fail110.d(17): declared here |
| 6 |
fail_compilation/fail110.d(20): Error: variable `i` is shadowing variable `fail110.main.i` |
| 7 |
fail_compilation/fail110.d(17): declared here |
| 8 |
fail_compilation/fail110.d(21): Error: variable `i` is shadowing variable `fail110.main.i` |
| 9 |
fail_compilation/fail110.d(17): declared here |
| 10 |
--- |
| 11 |
*/ |
| 12 |
|
| 13 |
// https://issues.dlang.org/show_bug.cgi?id=297 |
| 14 |
// Shadowing declarations allowed in foreach type lists |
| 15 |
void main() |
| 16 |
{ |
| 17 |
int i; |
| 18 |
int[] a; |
| 19 |
foreach (i; a) {} |
| 20 |
foreach (size_t i, n; a) {} |
| 21 |
for (int i;;) {} |
| 22 |
} |