diff options
Diffstat (limited to 'gcc/testsuite/gdc.test/compilable/test18216.d')
-rw-r--r-- | gcc/testsuite/gdc.test/compilable/test18216.d | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/test18216.d b/gcc/testsuite/gdc.test/compilable/test18216.d new file mode 100644 index 00000000000..43f5629a3c7 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/test18216.d @@ -0,0 +1,40 @@ +// https://issues.dlang.org/show_bug.cgi?id=18216 + +struct Node +{ + mixin Type!(); + Pointer left; +} + +mixin template Type() +{ + alias Base = typeof(this); + + static struct Proxy + { + struct Node + { + Base m_payload; + } + static immutable default_value = Base.init; // just remove this will work + } + + alias pNode = shared(Proxy.Node)*; + + static struct Pointer + { + Base* _ptr; + auto ptr() + { + return cast(pNode) _ptr; + } + + void opAssign(ref Pointer other) {} // just remove this will work + + alias getThis this; // just remove this will work + ref auto getThis() return + { + return ptr.m_payload; + } + } +} |