Debian Codegraph @

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

raw
1 /*
2 REQUIRED_ARGS: -verrors=context
3 TEST_OUTPUT:
4 ---
5 fail_compilation/staticforeach4.d(16): Error: index type `byte` cannot cover index range 0..257
6 static foreach (byte a, int b; data) { }
7 ^
8 fail_compilation/staticforeach4.d(17): Error: index type `byte` cannot cover index range 0..257
9 static foreach (byte a, int b; fn()) { }
10 ^
11 ---
12 */
13 immutable int[257] data = 1;
14 int[257] fn() { return data; }
15
16 static foreach (byte a, int b; data) { }
17 static foreach (byte a, int b; fn()) { }