Fixing module-scope private

Dicebot m.strashun at gmail.com
Sun Jan 27 05:58:06 PST 2013


Most annoying for me:

$ cat mod1.d
module mod1;

private void func(int) { }

$ cat mod2.d
import mod1;

void main() { func(42); }

$ rdmd mod2.d
mod2.d(3): Error: module mod2 mod1.func is private
mod2.d(3): Error: function mod1.func is not accessible from 
module mod2

With static in C and unnamed namespace in C++ those symbols do 
not participate in outer name resolution at all and do not exist 
as symbols in resulting object file.

Probably there are others, more subtle issues. I'll need to 
re-parse all discussion in that topic if going to try do a DIP 
about it.


More information about the Digitalmars-d mailing list