[Issue 2946] Make 'abstract' mandatory if the class is intended to be abstract

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 6 08:17:31 PDT 2009


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





------- Comment #1 from gide at nwawudu.com  2009-05-06 10:17 -------
Another example.

main.d
------
class Foo1 {
    abstract void foo();
}

class Bar1 : Foo1 {
}

abstract class Foo2 {
    abstract void foo();
}

class Bar2 : Foo2 {
}

void main () { 
    debug {
        auto f1 = new Bar1;
        auto f2 = new Bar2;
    }
}

C:> dmd -w -debug main.d
main.d(17): Error: cannot create instance of abstract class Bar1
main.d(17): Error: function foo is abstract
main.d(18): Error: cannot create instance of abstract class Bar2
main.d(18): Error: function foo is abstract

Should not compile or at least give a warning, but does neither.
C:> dmd -w main.d


-- 



More information about the Digitalmars-d-bugs mailing list