| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/issue11070.d(16): Error: undefined identifier `x` |
| 5 |
--- |
| 6 |
*/ |
| 7 |
|
| 8 |
int get() { return 1; } |
| 9 |
|
| 10 |
void test() { |
| 11 |
import std.stdio : writeln; |
| 12 |
switch (auto x = get()) { |
| 13 |
default: |
| 14 |
auto z = x; |
| 15 |
} |
| 16 |
x = 1; |
| 17 |
} |