digitalmars.D.bugs - [Bug 48] New: Acess with Fully-Qualified Names disregards protection attributes
- d-bugmail puremagic.com (25/25) Mar 14 2006 http://d.puremagic.com/bugzilla/show_bug.cgi?id=48
- d-bugmail puremagic.com (17/17) Mar 14 2006 http://d.puremagic.com/bugzilla/show_bug.cgi?id=48
http://d.puremagic.com/bugzilla/show_bug.cgi?id=48
Summary: Acess with Fully-Qualified Names disregards protection
attributes
Product: D
Version: 0.149
Platform: PC
OS/Version: Windows
Status: NEW
Severity: minor
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: daiphoenix lycos.com
Consider:
----- moduleFoo.d -----
module moduleFoo;
private void privateFunc() {}
Then in another module, accessing that entity with a fully qualified name will
disregard it's protection attribute:
----- ... -----
void func() {
privateFunc(); // Compile error, correct
moduleFoo.privateFunc(); // Compile ok , incorrect!
}
--
Mar 14 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=48
daiphoenix lycos.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Acess with Fully-Qualified |Access with Fully-Qualified
|Names disregards protection |Names disregards protection
|attributes |attributes
Actually, the erroneous behaviour of this bug is maybe happening too when using
*partially* qualified names. If so, this would effectively be the same bug as
"Protection Attributes not working for static member entities" such as when
doing:
Foo.privateStaticMethod(); // Compiles ok, incorrect!
which also (incorrectly) compiles ok, altough the following (correctly) doesn't
compile:
(new Foo).privateStaticMethod(); // privateStaticMethod is not accessible
--
Mar 14 2006








d-bugmail puremagic.com