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

           Summary: Protected class members in different file inaccessible
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: full.de...@gmail.com


--- Comment #0 from Taco <full.de...@gmail.com> 2012-01-05 14:50:24 PST ---
Example:

a.d:
class A
{
protected:
    void f()
    {
    }
}


main.d:
import a;

class B: A
{
public:
    void g(A a) // using g(B b) it works
    {
        a.f(); // error
    }
}

int main()
{
    auto b = new B;
    b.g(b);
}


dmd main.d a.d

Error: class a.A member f is not accessible


This is ONLY if A is in a different file (else B can access any of A its
members due to module accessibility). If g accepts B instead of A it works
though.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to