Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protected module members are supposed to be illegal #17884

Open
dlangBugzillaToGithub opened this issue Oct 29, 2018 · 2 comments
Open

Protected module members are supposed to be illegal #17884

dlangBugzillaToGithub opened this issue Oct 29, 2018 · 2 comments

Comments

@dlangBugzillaToGithub
Copy link

Mike Parker (@mdparker) reported this on 2018-10-29T10:14:51Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=19340

CC List

Description

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
@dlangBugzillaToGithub
Copy link
Author

razvan.nitu1305 commented on 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

@dlangBugzillaToGithub
Copy link
Author

pro.mathias.lang (@Geod24) commented on 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant