digitalmars.D.bugs - Protection attributes
- John C (30/30) Sep 17 2005 (Original post at
- =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= (18/58) Sep 20 2005 -----BEGIN PGP SIGNED MESSAGE-----
(Original post at
http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/28704)
Protection attributes on module-level class, struct, interface, enum,
template, alias and union delcarations (and possibly others) don't work.
Also, some protection attributes don't work on any module-level
declarations, eg constants.
Test code:
-prot.d-
module prot;
private interface IEngine {
void start();
}
private class Engine : IEngine {
void start() {
}
}
protected const int DEFAULT_SPOKES = 200;
protected struct Wheel {
int spokes;
}
-main.d-
module main;
import prot;
int main() {
Wheel wheel;
wheel.spokes = DEFAULT_SPOKES;
IEngine engine = new Engine;
engine.start();
return 0;
}
Sep 17 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John C schrieb:(Original post at http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/28704) Protection attributes on module-level class, struct, interface, enum, template, alias and union delcarations (and possibly others) don't work. Also, some protection attributes don't work on any module-level declarations, eg constants. Test code: -prot.d- module prot; private interface IEngine { void start(); } private class Engine : IEngine { void start() { } }Added to DStress as http://dstress.kuehne.cn/nocompile/pprivate_08_A.d http://dstress.kuehne.cn/nocompile/pprivate_08_B.d http://dstress.kuehne.cn/nocompile/pprivate_08_C.d http://dstress.kuehne.cn/nocompile/pprivate_08_D.d http://dstress.kuehne.cn/nocompile/pprivate_08_E.d http://dstress.kuehne.cn/nocompile/pprivate_08_F.dprotected const int DEFAULT_SPOKES = 200; protected struct Wheel { int spokes; }http://digitalmars.com/d/attribute.html-main.d- module main; import prot; int main() { Wheel wheel; wheel.spokes = DEFAULT_SPOKES; IEngine engine = new Engine; engine.start(); return 0; }Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDL8/r3w+/yD4P9tIRAogYAKCZ/E5VHdbxC889Wi49bg4uIOevhwCfSsab xOy+y8jcub09jjaEKyZXaK0= =oUqD -----END PGP SIGNATURE-----
Sep 20 2005








=?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= <thomas-dloop kuehne.cn>