Debian Codegraph @

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

raw
1 // https://issues.dlang.org/show_bug.cgi?id=18216
2
3 struct Node
4 {
5 mixin Type!();
6 Pointer left;
7 }
8
9 mixin template Type()
10 {
11 alias Base = typeof(this);
12
13 static struct Proxy
14 {
15 struct Node
16 {
17 Base m_payload;
18 }
19 static immutable default_value = Base.init; // just remove this will work
20 }
21
22 alias pNode = shared(Proxy.Node)*;
23
24 static struct Pointer
25 {
26 Base* _ptr;
27 auto ptr()
28 {
29 return cast(pNode) _ptr;
30 }
31
32 void opAssign(ref Pointer other) {} // just remove this will work
33
34 alias getThis this; // just remove this will work
35 ref auto getThis() return
36 {
37 return ptr.m_payload;
38 }
39 }
40 }