Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/fail11426.d

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail11426.d(15): Error: cannot implicitly convert expression `udarr` of type `uint[]` to `int[]`
5 fail_compilation/fail11426.d(16): Error: cannot implicitly convert expression `usarr` of type `uint[1]` to `int[]`
6 fail_compilation/fail11426.d(18): Error: cannot implicitly convert expression `udarr` of type `uint[]` to `int[]`
7 fail_compilation/fail11426.d(19): Error: cannot implicitly convert expression `usarr` of type `uint[1]` to `int[]`
8 ---
9 */
10 void main()
11 {
12 uint[] udarr;
13 uint[1] usarr;
14
15 int[1] arr1; arr1 = udarr; // Error, OK
16 int[1] arr2; arr2 = usarr; // Error, OK
17
18 int[1] arr3 = udarr; // accepted, BAD!
19 int[1] arr4 = usarr; // accepted, BAD!
20 }