April 02, 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=80

           Summary: Cannot instantiate nested class in nested function
           Product: D
           Version: 0.150
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: jarrett.billingsley@gmail.com


Interesting!

class A
{
        class B
        {

        }

        void fork()
        {
                B b = new B();  // This is okay

                void knife()
                {
                        B b = new B();  // No 'this' for nested class B
                }
        }
}

Blocked me from doing something rather elegant.


-- 

April 02, 2006
d-bugmail@puremagic.com schrieb am 2006-04-02:
> class A
> {
>         class B
>         {
>
>         }
>
>         void fork()
>         {
>                 B b = new B();  // This is okay
>
>                 void knife()
>                 {
>                         B b = new B();  // No 'this' for nested class B
>                 }
>         }
> }

Added to DStress as http://dstress.kuehne.cn/run/n/nested_class_04_A.d http://dstress.kuehne.cn/run/n/nested_class_04_B.d http://dstress.kuehne.cn/run/n/nested_class_04_C.d http://dstress.kuehne.cn/run/n/nested_class_04_D.d

Thomas