mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
19 lines
294 B
D
19 lines
294 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail11503b.d(17): Error: cannot implicitly convert expression `makes()` of type `immutable(int[])` to `int[]`
|
|
---
|
|
*/
|
|
immutable int[] x = [1, 2, 3];
|
|
|
|
auto makes() pure
|
|
{
|
|
return x;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
auto a = x;
|
|
int[] b = makes();
|
|
return b[1];
|
|
}
|