digitalmars.D.bugs - instantiation of class with abstract this() not caught by compiler
- Jarrett Billingsley (15/15) Dec 29 2004 I was looking into making classes abstract when I came across this.
- Thomas Kuehne (10/10) Dec 30 2004 -----BEGIN PGP SIGNED MESSAGE-----
-
Walter
(1/1)
Mar 09 2005
It's also fixed
.
I was looking into making classes abstract when I came across this. class Base { abstract this(); } void main() { Base b=new Base; } This compiles, but thankfully fails to link, as it cannot find the constructor function for Base. The compiler should catch this, as it throws an error if you try to instantiate a class with other undefined abstract methods. Unless of course, there is something that prohibits this from happening, in which case I'll eat my words ;)
Dec 29 2004
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Added to DStress as http://dstress.kuehne.cn/nocompile/abstract_05.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFB09gp3w+/yD4P9tIRApwHAJ9q9gCaSl1k94HE/SOuQLh48LaG6gCgjqeg u78Hbm+OufJuCjKG3HNp3r0= =QTNa -----END PGP SIGNATURE-----
Dec 30 2004