Bug 16004 – Document changes to protection attributes

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-05-08T19:42:00Z
Last change time
2016-10-01T11:45:44Z
Keywords
pull, spec
Assigned to
nobody
Creator
mathias.lang
See also
https://issues.dlang.org/show_bug.cgi?id=16287

Comments

Comment #0 by mathias.lang — 2016-05-08T19:42:38Z
Since 2.071, protection attributes is a misnomer, since it now participates in symbol lookup. `private` symbols won't conflict with same-named symbols in other modules for example, however the specs ( http://dlang.org/spec/attribute.html#ProtectionAttribute ) currently says otherwise. Hence this section is in need of a rename / overhaul. For reference, two links where the new behaviour was discussed: - DIP22 implementation: https://github.com/dlang/dmd/pull/5472 - Martin's comment in 15897: https://issues.dlang.org/show_bug.cgi?id=15897#c12 Name lookup is also not documented in the specs, and it might be worth making visibility and lookup rules be in their own, dedicated section. Leaving aside the current bugs, name lookup is now performed in two phases: - First local declarations / member of the scope - Then imports of that scope Scopes are considered in the following order: A) Local B) Mixin templates C) Base class D) Enclosing scope (starting from step A) Note: For the import part, there is an issue opened: https://issues.dlang.org/show_bug.cgi?id=15966 The underlying reason for this order is to forbid any local symbol hijacking (imported symbol hijacking is still possible) if a module introduces a new symbol.
Comment #1 by mathias.lang — 2016-06-10T14:44:32Z
Comment #2 by github-bugzilla — 2016-07-24T12:34:08Z
Commits pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/7bd44bc2c241af0c7131e32a3232bf6af6577664 Fix issue 16004 - Document changes to protection attributes - Rename to visibility attribute - Expand documentation on name lookup in module doc https://github.com/dlang/dlang.org/commit/58e99baec2ee7936d1534a51dace3da9a68ddd0a Merge pull request #1325 from mathias-lang-sociomantic/fix-16004 Fix issue 16004 - Document changes to protection attributes
Comment #3 by github-bugzilla — 2016-10-01T11:45:44Z
Commits pushed to stable at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/7bd44bc2c241af0c7131e32a3232bf6af6577664 Fix issue 16004 - Document changes to protection attributes https://github.com/dlang/dlang.org/commit/58e99baec2ee7936d1534a51dace3da9a68ddd0a Merge pull request #1325 from mathias-lang-sociomantic/fix-16004