gcc/testsuite/gdc.test/fail_compilation/aa_init.d
raw| 1 | /* |
| 2 | REQUIRED_ARGS: -vcolumns |
| 3 | TEST_OUTPUT: |
| 4 | --- |
| 5 | fail_compilation/aa_init.d(13,18): Error: invalid associative array initializer `[]`, use `null` instead |
| 6 | fail_compilation/aa_init.d(14,24): Error: missing key for value `4` in initializer |
| 7 | fail_compilation/aa_init.d(15,9): Error: cannot implicitly convert expression `[]` of type `void[]` to `int[int]` |
| 8 | --- |
| 9 | */ |
| 10 | |
| 11 | void main() |
| 12 | { |
| 13 | int[int] a = []; |
| 14 | int[int] b = [2:3, 4]; |
| 15 | a = []; |
| 16 | } |