Debian Codegraph @

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

raw
1 // https://issues.dlang.org/show_bug.cgi?id=21930
2 /*
3 TEST_OUTPUT:
4 ---
5 fail_compilation/test21930.d(21): Error: variable `string` is used as a type
6 fail_compilation/test21930.d(15): variable `string` is declared here
7 fail_compilation/test21930.d(26): Error: constructor `test21930.R.this(string)` is not callable using argument types `()`
8 ---
9 */
10
11 alias AliasSeq(T...) = T;
12
13 alias TP(alias name) = AliasSeq!name;
14
15 int string; // 'string' declared as a variable
16
17 alias a = TP!(main);
18
19 class R
20 {
21 this(string) { } // so constructor have errors
22 }
23
24 @system main()
25 {
26 new R;
27 }