www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - named import are always public

reply "Namespace" <rswhite4 googlemail.com> writes:
I have already found an old bug report for this, but I do not 
understand why it has still not been solved. Can someone explain 
that to me?

Example:

a.d:
----
module a;

private import std.stdio : writeln;
----

b.d:
----
import a;

void main() {
	writeln("This is wrong.");
}
----

WTF? writeln should be private.
I don't like this. :P
Sep 10 2013
next sibling parent "Gary Willoughby" <dev nomad.so> writes:
On Tuesday, 10 September 2013 at 08:22:18 UTC, Namespace wrote:
 I have already found an old bug report for this, but I do not 
 understand why it has still not been solved. Can someone 
 explain that to me?

 Example:

 a.d:
 ----
 module a;

 private import std.stdio : writeln;
 ----

 b.d:
 ----
 import a;

 void main() {
 	writeln("This is wrong.");
 }
 ----

 WTF? writeln should be private.
 I don't like this. :P
This is a WTF, where's the old report?
Sep 10 2013
prev sibling parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Tuesday, September 10, 2013 10:22:17 Namespace wrote:
 I have already found an old bug report for this, but I do not
 understand why it has still not been solved. Can someone explain
 that to me?
Simple. No one has gotten around to fixing it, just like with any other bug that hasn't been fixed yet. IIRC, there was an attempt to fix it a while back, but the fix was faulty, and AFAIK, no one has presented a correct fix since. Just like with any other bug, someone has to step up and take the time to fix it and submit a pull request with the fix. - Jonathan M Davis
Sep 10 2013
parent "Namespace" <rswhite4 googlemail.com> writes:
On Tuesday, 10 September 2013 at 09:35:34 UTC, Jonathan M Davis 
wrote:
 On Tuesday, September 10, 2013 10:22:17 Namespace wrote:
 I have already found an old bug report for this, but I do not
 understand why it has still not been solved. Can someone 
 explain
 that to me?
Simple. No one has gotten around to fixing it, just like with any other bug that hasn't been fixed yet. IIRC, there was an attempt to fix it a while back, but the fix was faulty, and AFAIK, no one has presented a correct fix since. Just like with any other bug, someone has to step up and take the time to fix it and submit a pull request with the fix. - Jonathan M Davis
There is the pull: https://github.com/D-Programming-Language/dmd/pull/2256
Sep 10 2013