[Issue 13261] New: `protected` base class members are not accessible using `super` in nested functions of derived class member functions

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Aug 5 07:26:10 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13261

          Issue ID: 13261
           Summary: `protected` base class members are not accessible
                    using `super` in nested functions of derived class
                    member functions
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: verylonglogin.reg at gmail.com

This code should compile:
---
module a;

class A
{
    protected int i;
}
---
import a;

class B: A
{
    void f()
    {
        () { ++i; } ();       // ok
        () { ++super.i; } (); // Error: i is not accessible
    }
}
---
main.d(8): Error: class a.A member i is not accessible
---

--


More information about the Digitalmars-d-bugs mailing list