www.digitalmars.com         C & C++   DMDScript  

D - but report

reply "Dario" <supdar yahoo.com> writes:
____________________
class Derived: Base
{}

class Base
{}
_____________________

Compiler output:
Asserion failure: 'structsize >= 8' on line 412 in file 'glue.c'

We can't write a derived class before its super one. Is this intentional? If
it is, it seems very strange, doesn't it? Has this been reported already?
Jul 04 2002
parent reply "Walter" <walter digitalmars.com> writes:
"Dario" <supdar yahoo.com> wrote in message
news:ag1vgt$1n7l$1 digitaldaemon.com...
 ____________________
 class Derived: Base
 {}

 class Base
 {}
 _____________________

 Compiler output:
 Asserion failure: 'structsize >= 8' on line 412 in file 'glue.c'

 We can't write a derived class before its super one. Is this intentional?
If
 it is, it seems very strange, doesn't it? Has this been reported already?
It is intentional, but you should have gotten a diagnostic rather than the assert notice.
Jul 04 2002
parent reply "Dario" <supdar yahoo.com> writes:
 class Derived: Base
 {}

 class Base
 {}
 _____________________

 Compiler output:
 Asserion failure: 'structsize >= 8' on line 412 in file 'glue.c'

 We can't write a derived class before its super one. Is this
intentional?
 If it is, it seems very strange, doesn't it? Has this been reported
already?
 It is intentional, but you should have gotten a diagnostic rather than the
 assert notice.
You wrote that the D source is interpreted as a whole. This looks like an exception. (And you hate exception, don't you?) I know that there is no need for this to change: nobody is writing a base class after a derived one. But IMHO this shouldn't be forbidden.
Jul 04 2002
parent "Walter" <walter digitalmars.com> writes:
"Dario" <supdar yahoo.com> wrote in message
news:ag2d5m$2594$1 digitaldaemon.com...
 It is intentional, but you should have gotten a diagnostic rather than
the
 assert notice.
You wrote that the D source is interpreted as a whole. This looks like an exception. (And you hate exception, don't you?) I know that there is no need for this to change: nobody is writing a base class after a derived one. But IMHO this shouldn't be forbidden.
Yeah, I hate exceptions. But there did turn out to be some chicken-and-egg problems.
Jul 05 2002