Bug 9318 – stack overflow if struct have alias this to this.init and has function,in which compare itself with init
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-14T07:57:00Z
Last change time
2013-01-21T14:24:57Z
Assigned to
nobody
Creator
zheny
Comments
Comment #0 by zheny — 2013-01-14T07:57:29Z
import std.stdio;
struct Bar
{
bool checkState()
{
return this == Bar.init;//if comment it all right
}
static @property Bar m_init()
{
return Bar.init;
}
alias m_init this;
}
void main()
{
}
This fails to compile with message "Stack overflow"
Comment #1 by k.hara.pg — 2013-01-21T14:24:57Z
This is a problem with self-recursive alias this.
*** This issue has been marked as a duplicate of issue 7437 ***