www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8885] New: Passing super class' private method as delegate allowed

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

           Summary: Passing super class' private method as delegate
                    allowed
           Product: D
           Version: D1 & D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: gavin.norman sociomantic.com



a.d
module a;
class A
{
    private d ( ) { }
}


b.d
module b;
import a;

class B : A
{
    void x ( void delegate ( ) dg ) { dg(); }

    void f ( )
    {
        x(&super.d); // Expected to not be allowed to access private method of
A
    }
}

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