gcc/testsuite/gdc.test/fail_compilation/fail22570.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=22570 |
| 2 | |
| 3 | /* |
| 4 | TEST_OUTPUT: |
| 5 | --- |
| 6 | fail_compilation/fail22570.d(19): Error: too many initializers for `S` with 1 field |
| 7 | fail_compilation/fail22570.d(20): Error: too many initializers for `S` with 1 field |
| 8 | --- |
| 9 | */ |
| 10 | |
| 11 | struct S |
| 12 | { |
| 13 | Object o1; |
| 14 | } |
| 15 | |
| 16 | void main() @safe |
| 17 | { |
| 18 | S[] s; |
| 19 | s = [S(null, null)]; |
| 20 | s ~= S(null, null); |
| 21 | } |