Thread overview
Nested Base classes
Dec 09, 2008
llee
Dec 09, 2008
BCS
December 09, 2008
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?
December 09, 2008
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.
December 09, 2008
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.