Thread overview
dmd: tocsym.c:135: virtual Symbol* VarDeclaration::toSymbol(): Assertion `!needThis()' failed.
Jul 03, 2004
Thomas Kuehne
Re: tocsym.c:135: virtual Symbol* VarDeclaration::toSymbol(): Assertion `!needThis()' failed.
Jul 06, 2004
Walter
Jul 06, 2004
Thomas Kuehne
Jul 07, 2004
Walter
Jul 07, 2004
Thomas Kuehne
July 03, 2004
dmd v0.94
Sorry, but I can't locate the actual source line that triggers this in a
rather large project.
July 06, 2004
"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


July 06, 2004
>> 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{}

July 07, 2004
"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.


July 07, 2004
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{};