Bug 50 – Error instantiating an inner class with a proper context

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-03-14T11:54:00Z
Last change time
2014-02-15T02:10:07Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
bruno.do.medeiros+deebugz

Comments

Comment #0 by bruno.do.medeiros+deebugz — 2006-03-14T11:54:04Z
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 }
Comment #1 by thomas-dloop — 2006-04-02T07:00:28Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] 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-----
Comment #2 by bugzilla — 2006-06-04T22:14:29Z
Fixed in 0.160, but it should be written as: Outer.Inner oi = o.new Inner;