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
Comment #2 by github-bugzilla — 2012-12-18T20:54:12Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6ef6b721642be8cb5a9ffbcef6f80d92fc071bc5 Fixes Issue 5385 - Access must be checked for static and __gshared fields. https://github.com/D-Programming-Language/dmd/commit/cdf27b20fda7e9832d5f85f1cebb0a1d15bb942e Merge pull request #1386 from AndrejMitrovic/Fix5385 Issue 5385 - Access must be checked for static and __gshared fields
Comment #3 by k.hara.pg — 2012-12-18T21:38:07Z
This is a part of issue 1161.