Bug 5385 – DMD doesn't block access to "static package" members
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2010-12-28T04:47:00Z
Last change time
2012-12-18T21:38:07Z
Keywords
accepts-invalid, pull
Assigned to
andrej.mitrovich
Creator
hypothermia.frost
Comments
Comment #0 by hypothermia.frost — 2010-12-28T04:47:34Z
DMD(2.051) doesn't generate access error for methods with static package attributes when accessed from another package.
For example:
module package.test;
class Test
{
static package int test; //static+package
package int test2;//only package
}
module main;
import std.stdio;
import package.test;
void main()
{
writeln(Test.test);//Should generate an error, but it doesn't!
auto t=new Test();
writeln(t.test2); //Generates an error correctly
}
Comment #1 by andrej.mitrovich — 2012-12-18T15:50:54Z