Bug 9327 – alias this declaration and unknown identifiers lead to segmentation fault
Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-16T11:04:18Z
Last change time
2018-10-10T23:00:58Z
Keywords
ice
Assigned to
No Owner
Creator
tvwhite51
Comments
Comment #0 by tvwhite51 — 2013-01-16T11:04:18Z
If two classes alias this each other and their is an unknown identifier DMD will fail with segmentation fault: 11. This is on DMD 2.061, Mac OS X 10.8.2.
Example:
class foo {
bar fun;
alias fun this;
this() {
fun = new bar(this);
fun.a = 5; //remove this line and the program will compile.
}
}
class bar {
foo sun;
alias sun this;
this(foo t) {
sun = t;
}
}
void main() {
foo fun = new foo;
}