[Issue 20642] New: protected member of superclass not accessible in subclass of inner class
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Mar  6 09:38:10 UTC 2020
    
    
  
https://issues.dlang.org/show_bug.cgi?id=20642
          Issue ID: 20642
           Summary: protected member of superclass not accessible in
                    subclass of inner class
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: default_357-line at yahoo.de
Consider the following code:
a.d:
class A {
  class Subclass { }
  protected void foo() { }
}
b.d:
class B : A {
  class Subclass : A.Subclass {
    void method() { foo; }
  }
}
Despite the fact that B.Subclass exists in a subclass of A twice over, this
errors with:
b.d(6): Error: class `a.A` member foo is not accessible
It works if I write 'this.outer.foo'.
It also works if I *don't* inherit B.Subclass from A.Subclass.
--
    
    
More information about the Digitalmars-d-bugs
mailing list