Summary: Derived class is implicitly castable to Base class when
                    inherited privately
           Product: D
           Version: 2.023
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

module A;

class A1
    void foo();

class A2 : private A1

module B;

void main() {
    A2 a2 = new A2();
    //; // Error: class A.A2 member foo is not accessible

    A1 a1 = a2;  // This line should yield an error;    // ta-dam! Private method invoked


Reply via email to