April 25, 2005 private members through mixins broken | ||||
---|---|---|---|---|
| ||||
****************************** module mymodule; template foo() { private int x; } class MyClass { mixin foo; } void main() { MyClass c; c.x = 1; } ****************************** Compilation results in the following error: class mymodule.MyClass.foo!() foo_.x is private Shouldn't x still be accessible within the same module just as normal private members? The same error is produced with structs as well. dmd 0.121 |
April 27, 2005 Re: private members through mixins broken | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike Parker schrieb am Mon, 25 Apr 2005 15:04:59 +0900: > ****************************** > module mymodule; > > template foo() > { > private int x; > } > > class MyClass > { > mixin foo; > } > > void main() > { > MyClass c; > c.x = 1; > } > ****************************** > > > Compilation results in the following error: > class mymodule.MyClass.foo!() foo_.x is private > > Shouldn't x still be accessible within the same module just as normal private members? The same error is produced with structs as well. > > dmd 0.121 Added to DStress as http://dstress.kuehne.cn/run/private_07.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCbykO3w+/yD4P9tIRAtHOAJ4hi5ZL/ryj+53p+jqd0M1M/HpHqACgli0l XiIW3jlqjB9H25tZqIGVX3w= =BGE0 -----END PGP SIGNATURE----- |
Copyright © 1999-2021 by the D Language Foundation