| 1 |
/* RUN_OUTPUT: |
| 2 |
--- |
| 3 |
inside switch: 1 |
| 4 |
--- |
| 5 |
*/ |
| 6 |
|
| 7 |
int get() { return 1; } |
| 8 |
|
| 9 |
void test() { |
| 10 |
import core.stdc.stdio : printf; |
| 11 |
switch (auto x = get()) { |
| 12 |
default: |
| 13 |
printf("inside switch: %d\n", x); |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
void main() { |
| 18 |
test(); |
| 19 |
} |