Please remember to assign keywords to bug reports. To everybody reading this: Please look through issues you've reported and check for missing keywords.
As I try it in DMD 1.020 (Windows), I don't get a crash, but these error messages:
bz717a.d(2): class bz717a.main.T!().A has forward references
bz717a.d(4): class bz717a.main.T!().B has forward references
bz717b.d(2): class bz717b.main.T!().B has forward references
If I put the classes into main directly....
----------
void main(){
class B : A{
}
class A{
}
}
----------
bz717c.d(2): Error: identifier 'A' is not defined
bz717c.d(2): Error: A is used as a type
bz717c.d(2): class bz717c.main.B base type must be class or interface, not void
----------
I'm not sure if your second testcase and mine should be legal. It's in the spec (unless it's changed since I looked) that nested functions can't forward-reference each other, but I'm not sure if this applies to classes within functions as well.
Comment #2 by bugzilla — 2007-10-30T23:02:52Z
Gives decent error message, no seg fault, with dmd 1.022 and 2.006.