Protected module members -- regression?

Mike Parker aldacron at gmail.com
Mon Oct 29 16:20:03 UTC 2018


On Monday, 29 October 2018 at 15:45:16 UTC, Steven Schveighoffer 
wrote:

> D has a history of ignoring inapplicable attributes. I would 
> expect this is probably the same thing.
>

That would have been my inclination, except that the spec 
explicitly says this [1]:

"protected module members are illegal."

I went back to the D1 docs because I was sure I had seen that 
years ago, and there it is [2] in the same words.

When I get a bit of time, I'll test it out on some ancient 
compilers. I guess at this point it's safe to assume that it's 
never been treated as an error, meaning it isn't a regression but 
a long-standing mismatch between the spec and the implementation, 
and the actual regression is the deprecation message that 
shouldn't be applied here.

[1] https://dlang.org/spec/attribute.html#visibility_attributes
[2] 
https://digitalmars.com/d/1.0/attribute.html#ProtectionAttribute


More information about the Digitalmars-d mailing list