Thread overview
[Bug 50] New: Error instantiating an inner class with a proper context
Mar 14, 2006
d-bugmail
Apr 02, 2006
Thomas Kuehne
Jun 05, 2006
d-bugmail
March 14, 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=50

           Summary: Error instantiating an inner class with a proper context
           Product: D
           Version: 0.149
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: daiphoenix@lycos.com


The following gives a compiler error (as in the comment), despite the proper
context pointer (this) being available:

class Outer
{
  class Inner { }
}

void func()
{
  Outer o = new Outer;
  Outer.Inner oi = new o.Inner; // Error: no 'this' for nested class Inner
}


-- 

April 02, 2006
d-bugmail@puremagic.com schrieb am 2006-03-14:
> The following gives a compiler error (as in the comment), despite the proper
> context pointer (this) being available:
>
> class Outer
> {
>   class Inner { }
> }
>
> void func()
> {
>   Outer o = new Outer;
>   Outer.Inner oi = new o.Inner; // Error: no 'this' for nested class Inner
> }

Added to DStress as http://dstress.kuehne.cn/run/n/nested_class_05_A.d http://dstress.kuehne.cn/run/n/nested_class_05_B.d

Thomas


June 05, 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=50


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from bugzilla@digitalmars.com  2006-06-04 22:14 -------
Fixed in 0.160, but it should be written as:

Outer.Inner oi = o.new Inner;


--