Thread overview
instantiation of class with abstract this() not caught by compiler
Dec 30, 2004
Thomas Kuehne
Mar 10, 2005
Walter
December 30, 2004
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 ;)


December 30, 2004
Added to DStress as http://dstress.kuehne.cn/nocompile/abstract_05.d

Thomas

March 10, 2005
It's also fixed <g>.