www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2342] New: derived nested classes in derived outer class.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2342

           Summary: derived nested classes in derived outer class.
           Product: D
           Version: 1.035
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: benoit tionex.de


This should compile but does not.

class A {
    class I1{
    }
}

class B : A {
    class I2 : I1 { // line 9
    }

    I1 getI(){
        return new I2;
    }
}
void main(){}

test.d(9): class test.B.I2 is nested within B, but super class I1 is nested
within A


-- 
Sep 07 2008
next sibling parent reply "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Sun, Sep 7, 2008 at 8:59 AM,  <d-bugmail puremagic.com> wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=2342

           Summary: derived nested classes in derived outer class.
           Product: D
           Version: 1.035
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: benoit tionex.de


 This should compile but does not.

 class A {
    class I1{
    }
 }

 class B : A {
    class I2 : I1 { // line 9
    }

    I1 getI(){
        return new I2;
    }
 }
 void main(){}

 test.d(9): class test.B.I2 is nested within B, but super class I1 is nested
 within A


 --

Are you *sure* this should compile or do you *want* it to compile? There's a difference ;) I believe back in 0.126 when nested classes were implemented, I suggested this to Walter and the official response was "AIIIIIIEEEEEE", or something like that. Translation: probably too much trouble to be worth it?
Sep 07 2008
parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Jarrett Billingsley schrieb:
 On Sun, Sep 7, 2008 at 8:59 AM,  <d-bugmail puremagic.com> wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=2342

           Summary: derived nested classes in derived outer class.
           Product: D
           Version: 1.035
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: benoit tionex.de


 This should compile but does not.

 class A {
    class I1{
    }
 }

 class B : A {
    class I2 : I1 { // line 9
    }

    I1 getI(){
        return new I2;
    }
 }
 void main(){}

 test.d(9): class test.B.I2 is nested within B, but super class I1 is nested
 within A


 --

Are you *sure* this should compile or do you *want* it to compile? There's a difference ;) I believe back in 0.126 when nested classes were implemented, I suggested this to Walter and the official response was "AIIIIIIEEEEEE", or something like that. Translation: probably too much trouble to be worth it?

I don't know. I had *expected* this to work :)
Sep 07 2008
parent reply "Manfred_Nowak" <svv1999 hotmail.com> writes:
Frank Benoit wrote:

 I don't know. I had *expected* this to work :)

This was the answer: http://www.digitalmars.com/webnews/newsgroups.php? art_group=digitalmars.D.announce&article_id=783 Do you have acompelling example? -manfred -- If life is going to exist in this Universe, then the one thing it cannot afford to have is a sense of proportion. (Douglas Adams)
Sep 08 2008
parent Frank Benoit <keinfarbton googlemail.com> writes:
Manfred_Nowak schrieb:
 Frank Benoit wrote:
 
 I don't know. I had *expected* this to work :)

This was the answer: http://www.digitalmars.com/webnews/newsgroups.php? art_group=digitalmars.D.announce&article_id=783 Do you have acompelling example? -manfred

In real live Java code i found this constellation while porting it. Sure, i found a workaround, but that is not nice.
Sep 08 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2342





------- Comment #1 from helmutduregger gmx.at  2009-01-20 05:07 -------
Seems to be related to http://d.puremagic.com/issues/show_bug.cgi?id=1175


-- 
Jan 20 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2342


David Ferenczi <david ferenczi.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |david ferenczi.net
         Resolution|                            |DUPLICATE


--- Comment #2 from David Ferenczi <david ferenczi.net> 2009-09-10 05:43:28 PDT
---
*** This issue has been marked as a duplicate of issue 1175 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 10 2009