www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - private selective import not so private ?

reply "BBasile" <bb.temp gmx.com> writes:
While trying to get why some call to memmove without the right 
import didn't lead to a compilation failure i've found that 
imported symbols are not private ! Is that a bug ? The specs 
don't say that a selective import is public !

-- other.d --
module other;
private import core.stdc.string: memmove;
-------------

-- main.d --
module main;
import other;
void main()
{
     void* a,b;
     memmove(a,b,0);
}
------------

command `dmd main.d other.d: ok compiles without error.
win32, tested with latest beta, and 2 previous versions.
Sep 10 2015
parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
On Friday, 11 September 2015 at 00:52:00 UTC, BBasile wrote:
 While trying to get why some call to memmove without the right 
 import didn't lead to a compilation failure i've found that 
 imported symbols are not private ! Is that a bug ? The specs 
 don't say that a selective import is public !
Yes, it is one of the oldest, most infamous bugs D has, the https://issues.dlang.org/show_bug.cgi?id=314
Sep 10 2015
next sibling parent "BBasile" <bb.temp gmx.com> writes:
On Friday, 11 September 2015 at 00:55:41 UTC, Adam D. Ruppe wrote:
 On Friday, 11 September 2015 at 00:52:00 UTC, BBasile wrote:
 While trying to get why some call to memmove without the right 
 import didn't lead to a compilation failure i've found that 
 imported symbols are not private ! Is that a bug ? The specs 
 don't say that a selective import is public !
Yes, it is one of the oldest, most infamous bugs D has, the https://issues.dlang.org/show_bug.cgi?id=314
Damn, you break my joy...
Sep 10 2015
prev sibling parent "Gary Willoughby" <dev nomad.so> writes:
On Friday, 11 September 2015 at 00:55:41 UTC, Adam D. Ruppe wrote:
 On Friday, 11 September 2015 at 00:52:00 UTC, BBasile wrote:
 While trying to get why some call to memmove without the right 
 import didn't lead to a compilation failure i've found that 
 imported symbols are not private ! Is that a bug ? The specs 
 don't say that a selective import is public !
Yes, it is one of the oldest, most infamous bugs D has, the https://issues.dlang.org/show_bug.cgi?id=314
Walter, Andrei, when is this ever going to be addressed? It catches out so many people, me included and is raised on this newsgroup over and over again.
Sep 11 2015