www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Bug 50] New: Error instantiating an inner class with a proper context

reply d-bugmail puremagic.com writes:
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
}


-- 
Mar 14 2006
next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 -----BEGIN PGP SIGNATURE----- iD4DBQFEL8Mh3w+/yD4P9tIRAg4yAJiBGpAyl8CZK0UDy3aa38AeIW9TAJ9OMfnC pZBZAn2q8eSf9ix7zL6o1Q== =pzMD -----END PGP SIGNATURE-----
Apr 02 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=50


bugzilla digitalmars.com changed:

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





Fixed in 0.160, but it should be written as:

Outer.Inner oi = o.new Inner;


-- 
Jun 04 2006