[Issue 717] toobj.c:191: virtual void ClassDeclaration::toObjFile(): Assertion `!scope' failed.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 18 13:49:07 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=717


smjg at iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg at iname.com
           Keywords|                            |diagnostic, ice-on-invalid-
                   |                            |code




------- Comment #1 from smjg at iname.com  2007-09-18 15:49 -------
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.


-- 



More information about the Digitalmars-d-bugs mailing list