Bug 19340 – Protected module members are supposed to be illegal

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-10-29T10:14:51Z
Last change time
2024-12-13T19:01:06Z
Assigned to
No Owner
Creator
Mike Parker
Moved to GitHub: dmd#17884 →

Comments

Comment #0 by aldacron — 2018-10-29T10:14:51Z
I've marked this as a regression because the docs [1] say: "protected module members are illegal." However, the compiler not complain about protected module members: ``` module a; // This compiles protected int wrong; ``` ``` module b; import std.stdio; import a; int main() { writeln(wrong); } ``` Instead, it gives the deprecation message about visibility: "Deprecation: a.wrong is not visible from module b" With -d, it compiles and runs. [1] https://dlang.org/spec/attribute.html#visibility_attributes
Comment #1 by razvan.nitu1305 — 2018-10-31T13:52:49Z
If an issue is marked as an regression it has to state which is the last compiler version that implemented the feature correctly. Downgrading to normal
Comment #2 by pro.mathias.lang — 2020-03-02T16:50:10Z
I'm all for changing the docs and treating `protected` at module scope as `private`. It's more permissive, but I doubt it'll surprise anyone.
Comment #3 by robert.schadek — 2024-12-13T19:01:06Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17884 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB