www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - call to private super-constructor should not be allowed

Recently I realized that a inheriting class is able to call the
super-constructor of its super-class even if it is declared private.
My expectation was that the compiler would force me to call a explicit
super-constructor which is not declared private. Well, it didn't. It compiles
and even linking is no problem.

For illustration of the described problem consider the following example. The
different classes are located in different files.

module abstractClass;

abstract class AbstractClass
    private this()
import abstractClass;

class InheritingClass : AbstractClass
    public this()

Compiler used: Digital Mars D Compiler v1.015 and GDC 0.22 (both affected)
System: Linux x86
Sep 24 2007