Bug 4813 – trait for getting at access modifiers

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-09-04T19:13:00Z
Last change time
2013-01-07T17:20:50Z
Keywords
pull
Assigned to
nobody
Creator
issues.dlang

Comments

Comment #0 by issues.dlang — 2010-09-04T19:13:08Z
As far as I can determine, __traits and std.traits do not currently give you the means to determine the access modifier for a given type or function - i.e. private, package, protected, or public. There are times when that information is necessary to verify APIs with unit tests, and it could matter for generated code which could need to know what the public API without mixing the other functions or variables in which have other access levels. Please add a function or set of functions (or trait argument for __traits) which gives access to that information.
Comment #1 by andrej.mitrovich — 2012-12-20T13:19:38Z
https://github.com/D-Programming-Language/dmd/pull/856 We may want to wrap it in a Phobos template though.