[Issue 3602] cannot compile a class, if its super class has preconditions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 8 08:49:27 PST 2009


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



--- Comment #1 from Qian Xu <qian.xu at funkwerk-itk.com> 2009-12-08 08:49:26 PST ---
Sorry for the first commit. The description is incomplete.

Now the part 2:

I have two classes as follows:

====== FILE: Box.d ======
module Box;
class Box {
   void paint(int x, int y)
   in {
       assert(x > 0);
       assert(y > 0);
   }
   body {
   }
}
====== FILE: Box.d ======

====== FILE: ImageBox.d ======
module ImageBox;
class ImageBox: Box {
   void override paint(int x, int y)
   in {
       assert(x > 0);
       assert(y > 0);
   }
   body {
   }
}
====== FILE: ImageBox.d ======

I compile the Box.d using "dmd -w -debug -inline -version=Posix -version=Tango
Box.d -c", it works.
And then I compile the ImageBox.d using "dmd -w -debug -inline -version=Posix
-version=Tango ImageBox.d -c", the dmd compile returns an error.
========= ERROR =========
Box.d(7): Error: function __require forward declaration
linkage = 0
dmd: tocsym.c:381: virtual Symbol* FuncDeclaration::toSymbol(): Assertion `0'
failed.
Aborted
========= ERROR =========


Note that if I write "private" before this method paint, it works. 


I think this issue is pretty critical, now I have to remove all preconditions
in my super classes.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list