Bug 619 – Alias of templated struct instance crashes 0.175
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-29T17:42:00Z
Last change time
2014-02-15T13:19:31Z
Assigned to
bugzilla
Creator
kirklin.mcdonald
Comments
Comment #0 by kirklin.mcdonald — 2006-11-29T17:42:20Z
The following code crashes DMD 0.175, but works in DMD 0.174:
import std.stdio;
struct Foo {
int i;
}
template some_struct_instance(T) {
static Foo some_struct_instance = {
5, /*i*/
};
}
void main() {
alias some_struct_instance!(int) inst;
writefln(inst.i);
}
Curiously, it works if main is rewritten like this:
void main() {
writefln(some_struct_instance!(int).i);
}
Comment #1 by matti.niemenmaa+dbugzilla — 2006-12-03T04:11:15Z