www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20329] New: Type nested inside two interfaces not visible in

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

          Issue ID: 20329
           Summary: Type nested inside two interfaces not visible in
                    outermost type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: simen.kjaras gmail.com

interface A {
    interface B : A {
        class C : B {
            void inside(C c) {}
        }
        // Works
        void innermost(A.B.C c);
    }
    // Fails: no property 'C' for type 'foo.A.B'
    void inside(A.B.C c) { }
}
// Works
void outside(A.B.C c) { }

Adding another layer of interfaces keeps the same kind of pattern:

interface A {
    interface B : A {
        interface C : B {
            class D : C {
                void fun(D d) {}
            }
        }
        // Fails
        void fun(A.B.C.D d);
    }
}

--
Oct 27 2019