www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Nested Base classes

reply llee <larry workingwondersus.com> writes:
I'm trying derive a class from a nested base class. The programs' structure is
as follows:

class A
{
     class B
     {
     }
}

class C : A
{
     class D : B
     {
     }
}

I'm using version 2.014 of the dmd compiler, and the above fails. The compiler
error reports that B is nested in class A and not C. Does anyone know a work
around?
Dec 09 2008
next sibling parent "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Tue, Dec 9, 2008 at 2:08 PM, llee <larry workingwondersus.com> wrote:
 I'm trying derive a class from a nested base class. The programs' structure is
as follows:

 class A
 {
     class B
     {
     }
 }

 class C : A
 {
     class D : B
     {
     }
 }

 I'm using version 2.014 of the dmd compiler, and the above fails. The compiler
error reports that B is nested in class A and not C. Does anyone know a work
around?

It's not possible, and I doubt it ever will be.
Dec 09 2008
prev sibling parent BCS <ao pathlink.com> writes:
Reply to llee,

 I'm trying derive a class from a nested base class. The programs'
 structure is as follows:
 
 class A
 {
 class B
 {
 }
 }
 class C : A
 {
 class D : B
 {
 }
 }
 I'm using version 2.014 of the dmd compiler, and the above fails. The
 compiler error reports that B is nested in class A and not C. Does
 anyone know a work around?
 

That's on the feature request list somewhere.
Dec 09 2008