See sample code. Very easy to reproduce.
$ gdc -o /tmp/bug.o -c /tmp/bug.d
/tmp/bug.d:7: Error: Need 'this' to access member f
/tmp/bug.d:8: Error: Need 'this' to access member f
/tmp/bug.d: In function 'init':
/tmp/bug.d:8: internal compiler error: Segmentation fault: 11
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Exit 1
### BEGIN CODE ###
class Foo {
void bar() { }
}
class Bug {
static Bug init() {
f = new Foo();
f.bar();
Bug ret = new Bug();
return ret;
}
private:
Foo f;
}
### END CODE ###
Comment #1 by witold.baryluk+d — 2007-09-02T08:41:19Z
Simpler example.
module bug;
class X {
char[] name;
static void a() {
assert(name is null);
}
}
void main() {
}