[Issue 2417] New: protected base member is not available via base hanlde in a derived class if it is defined in a separate module

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 13 16:18:41 PDT 2008


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

           Summary: protected base member is not available via base hanlde
                    in a derived class if it is defined in a separate module
           Product: D
           Version: 2.019
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: 2korden at gmail.com


The subject says it all, here is a sample:

module m1;
class M1
{
    protected void foo() {}
}

module m2;
import m1;

class M2 : public M1
{
    void bar()
    {
        M1 m1 = new M1();
        m1.foo();         // fails* 

        M2 m2 = new M2();
        m2.foo();         // ok
    }
}

* m2.d(9): class m1.M1 member foo is not accessible


-- 



More information about the Digitalmars-d-bugs mailing list