Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail22006.d(15): Error: cannot implicitly convert expression `4$?:32=u|64=LU$` of type `$?:32=uint|64=ulong$` to `bool`
5 fail_compilation/fail22006.d(16): Error: index type `bool` cannot cover index range 0..4
6 fail_compilation/fail22006.d(19): Error: cannot implicitly convert expression `4$?:32=u|64=LU$` of type `$?:32=uint|64=ulong$` to `bool`
7 fail_compilation/fail22006.d(20): Error: index type `bool` cannot cover index range 0..4
8 ---
9 */
10 void test22006()
11 {
12 alias AliasSeq(TList...) = TList;
13 {
14 alias aseq = AliasSeq!(0, 1, 2, 3);
15 static foreach (bool i; 0 .. aseq.length) {}
16 static foreach (bool i, x; aseq) {}
17 }
18 {
19 static foreach (bool i; 0 .. [0, 1, 2, 3].length) {}
20 static foreach (bool i, x; [0, 1, 2, 3]) {}
21 }
22 }