[Bug or feature] nested class inheritance

David Ferenczi raggae at ferenczi.net
Sun Apr 15 06:44:31 PDT 2007


Compiling the code below gives an error message:

----------------8<---------------------------------
int main(char[][] args)
{
    class A
    {
        protected:
            class AA {}
    }

    class B : A
    {
        protected:
            class BB : AA {}
    }

    return 0;
}
----------------8<---------------------------------


test.d(15): class test.main.B.BB super class AA is nested within A, not B


Is it the intended behaviour?
Does it mean that nested classes wont get inherited, thus cannot be used in
the subclass?

Thanks in advance,
regards,
David




More information about the Digitalmars-d-learn mailing list