← Back to index
|
Original Bugzilla link
Bug 8300 – Stack overflow with alias this
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2012-06-26T00:50:00Z
Last change time
2012-06-26T01:22:31Z
Assigned to
nobody
Creator
rswhite4
Comments
Comment #0
by rswhite4 — 2012-06-26T00:50:10Z
If i don't comment out the lines here, the compiler will print "Stack overflow" all the time. I think that's a compiler bug. [code] struct Test(T) { private: T _val; public: /+ @disable this(typeof(null)); +/ /+ this(int i) { } +/ this(T obj) { } @property inout(T) Get() inout { return this._val; } alias Get this; } mixin template TRef(T) { private: Test!(T) _ref; void InitRef() { this._ref = Test!(T)(this); } public: @property inout(Test!(T)) Get() inout { return this._ref; } } class Foo { public: mixin TRef!(Foo); this() { InitRef(); } /+ void echo() const pure nothrow { writeln("Foo"); } +/ alias Get this; } void main() { } [/code]
Comment #1
by k.hara.pg — 2012-06-26T01:22:31Z
*** This issue has been marked as a duplicate of issue 8053 ***