Debian Codegraph @

gcc/testsuite/gdc.test/compilable/issue16472.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=16472
2 enum e() = 0;
3
4 template t(alias v = e!()) {} //Error
5 alias dummy = t!(e!());
6
7 template E(F){
8 enum E {
9 K = F(1)
10 }
11 }
12
13 struct S(F = float, alias e_ = E!double.K) {}
14 S!float x; // Error: E!double.K is used as a type
15
16 alias T = E!double.K;
17 struct S2(F = float, alias e_ = T) {}
18 S2!float y; // alias makes it okay...
19
20 struct S3(F = float, alias e_ = (E!double.K)) {}
21 S3!float z; // just putting parens make it okay as well... wat!?
22
23 // for coverage
24
25 template G(T)
26 {
27 struct G
28 {
29 alias I = int;
30 static int i;
31 }
32 }
33
34 struct H(F = float, alias e_ = G!double) {}
35 H!float a;
36
37 struct H1(F = float, alias e_ = G!double.I) {}
38 H1!float b;
39
40 // https://issues.dlang.org/show_bug.cgi?id=21795
41 // struct H2(F = float, alias e_ = G!double.i) {}
42 // H2!float c;