Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail162.d(25): Error: template `testHelper` is not callable using argument types `!()(string, string)`
5 fail_compilation/fail162.d(10): Candidate is: `testHelper(A...)()`
6 fail_compilation/fail162.d(30): Error: template instance `fail162.test!("hello", "world")` error instantiating
7 ---
8 */
9
10 template testHelper(A ...)
11 {
12 char[] testHelper()
13 {
14 char[] result;
15 foreach (t; a)
16 {
17 result ~= "int " ~ t ~ ";\r\n";
18 }
19 return result;
20 }
21 }
22
23 template test(A...)
24 {
25 const char[] test = testHelper(A);
26 }
27
28 int main(char[][] args)
29 {
30 mixin(test!("hello", "world"));
31 return 0;
32 }