www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - dmd: tocsym.c:135: virtual Symbol* VarDeclaration::toSymbol(): Assertion `!needThis()' failed.

reply Thomas Kuehne <eisvogel users.sourceforge.net> writes:
dmd v0.94 
Sorry, but I can't locate the actual source line that triggers this in a
rather large project.
Jul 03 2004
parent reply "Walter" <newshound digitalmars.com> writes:
"Thomas Kuehne" <eisvogel users.sourceforge.net> wrote in message
news:cc78tj$1l4l$1 digitaldaemon.com...
 dmd v0.94
 Sorry, but I can't locate the actual source line that triggers this in a
 rather large project.
The only way to track this down is to follow the techniques here: www.digitalmars.com/bugs.html
Jul 06 2004
parent reply Thomas Kuehne <eisvogel users.sourceforge.net> writes:
 Sorry, but I can't locate the actual source line that triggers this in a
 rather large project.
 The only way to track this down is to follow the techniques here:
 
 www.digitalmars.com/bugs.html
Well, I still can't locate the troublesome lines but found 2 (?related?) bugs in the same project: // save this in a file NOT named "object.d" // dmd: glue.c:429: virtual void ClassDeclaration::toObjFile(): Assertion `classinfo->structsize == 0x3C' failed. class ClassInfo{} // save this in a file named "object.d" and get: // object.d(3): identifier 'Object' is not defined class Hallo{}
Jul 06 2004
parent reply "Walter" <newshound digitalmars.com> writes:
"Thomas Kuehne" <eisvogel users.sourceforge.net> wrote in message
news:ccf6vj$1dcc$1 digitaldaemon.com...
 Well, I still can't locate the troublesome lines but found 2 (?related?)
 bugs in the same project:

 // save this in a file NOT named "object.d"
 // dmd: glue.c:429: virtual void ClassDeclaration::toObjFile(): Assertion
`classinfo->structsize == 0x3C' failed.
 class ClassInfo{}

 // save this in a file named "object.d" and get:
 // object.d(3): identifier 'Object' is not defined
 class Hallo{}
module object.d is reserved, as well as class Object and class ClassInfo which are defined in object.d. The compiler is intimate with them, and will fall over if they aren't as expected. Of course, such errors should be better detected by the compiler.
Jul 07 2004
parent Thomas Kuehne <eisvogel users.sourceforge.net> writes:
Walter wrote:

 // save this in a file NOT named "object.d"
 // dmd: glue.c:429: virtual void ClassDeclaration::toObjFile(): Assertion
`classinfo->structsize == 0x3C' failed.
 class ClassInfo{}

 // save this in a file named "object.d" and get:
 // object.d(3): identifier 'Object' is not defined
 class Hallo{}
module object.d is reserved, as well as class Object and class ClassInfo which are defined in object.d. The compiler is intimate with them, and will fall over if they aren't as expected. Of course, such errors should be better detected by the compiler.
Not only "object.d" but also "mylib/object.d" etc. will cause this problem. In my view the code below should not trigger the problem(currently it does): module mylib; class ClassInfo{};
Jul 07 2004