Bug 8053 – Recursive alias this causes infinite loop
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-06T07:02:00Z
Last change time
2013-03-06T18:04:12Z
Keywords
ice, pull
Assigned to
nobody
Creator
simen.kjaras
Comments
Comment #0 by simen.kjaras — 2012-05-06T07:02:59Z
class A {
B b;
alias b this;
}
class B {
A a;
alias a this;
}
void main( ) {
A a = 3;
}
The above code causes a stack overflow in DMD. The problem is there is no loop-detection in the alias this implementation, so it will try the same type over and over.
Comment #1 by k.hara.pg — 2012-06-26T01:22:31Z
*** Issue 8300 has been marked as a duplicate of this issue. ***