[Issue 19340] New: Protected module members are supposed to be illegal
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Mon Oct 29 10:14:51 UTC 2018
    
    
  
https://issues.dlang.org/show_bug.cgi?id=19340
          Issue ID: 19340
           Summary: Protected module members are supposed to be illegal
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: aldacron at gmail.com
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
--
    
    
More information about the Digitalmars-d-bugs
mailing list