| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/fail21928.d(18): Error: this array literal causes a GC allocation in `@nogc` function `main` |
| 5 |
--- |
| 6 |
*/ |
| 7 |
|
| 8 |
@nogc: |
| 9 |
|
| 10 |
|
| 11 |
struct Shape |
| 12 |
{ |
| 13 |
immutable size_t[] dims = []; |
| 14 |
} |
| 15 |
|
| 16 |
void main() |
| 17 |
{ |
| 18 |
auto s = Shape(2 ~ Shape.init.dims); |
| 19 |
} |