[Issue 314] Static, renamed, and selective imports are always public
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 16 12:29:25 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=314
------- Comment #3 from kamm-removethis at incasoftware.de 2008-04-16 14:29 -------
Created an attachment (id=246)
--> (http://d.puremagic.com/issues/attachment.cgi?id=246&action=view)
Fix by checking protection attribute for all nonlocal symbols
The patch has been tested rudimentarily on llvmdc. I have commented the two
crucial changes.
Even if there is a good reason for not checking the protection attribute of all
symbols, it should still be simple to special case this fix for import
declarations and the alias declarations generated by them.
Note that
module c;
int var;
--
module b;
import c;
--
module a;
import b;
void main {
var = 1; // var: undefined identifier (no change)
c.var = 1; // c: undefined identifier (instead of ok)
b.c.var = 1; // still ok
}
--
More information about the Digitalmars-d-bugs
mailing list