gcc/testsuite/gdc.test/fail_compilation/fail11503b.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail11503b.d(17): Error: cannot implicitly convert expression `makes()` of type `immutable(int[])` to `int[]` |
| 5 | --- |
| 6 | */ |
| 7 | immutable int[] x = [1, 2, 3]; |
| 8 | |
| 9 | auto makes() pure |
| 10 | { |
| 11 | return x; |
| 12 | } |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | auto a = x; |
| 17 | int[] b = makes(); |
| 18 | return b[1]; |
| 19 | } |