Thread overview
'private import' and 'private alias' is not working.
Feb 26, 2009
CLXX
Feb 26, 2009
Christopher Wright
Feb 27, 2009
CLXX
Feb 27, 2009
Gide Nwawudu
February 26, 2009
I found some private attributes is not working.
DMD 2.025 Windows

//aaa.d
private static import std.string;
private alias std.string.find find;
private import std.conv: to;

// main.d
import aaa;
void main( ){
  string x = "main.d";
  find( x, "." ); // should be ERROR!
  std.string.ifind( x, "." ); // sould be ERROR?
  to!( wstring )( x ); // sould be ERROR?
}

First, 'find' in 'main.d' should not be accessible because 'alias' has 'private' attribute.
Second 'std.string.ifind' should not be accessible I think, because 'std.string' in 'aaa.d' is imported privately.
Third, 'to' in 'main.d' should not be accessible I think, because 'std.conv' is imported privately.

If we want to use 'std.string.ifind' in 'main.d', we can import 'std.string' in 'main.d'. And the same, in order to use 'to' in 'main.d', we should import 'std.conv: to'.

Less symbols we can see, more easily we can get.
February 26, 2009
CLXX wrote:
> I found some private attributes is not working.

Private imports work if you just do "private import foo;".
They fail if the import is also static.
They fail if the import is renamed.
They fail if the import is selective.
There is a bugzilla entry for this somewhere.
February 27, 2009
> There is a bugzilla entry for this somewhere.

Thank you for your reply.
I'm surprised to see so early.
February 27, 2009
On Thu, 26 Feb 2009 18:05:46 -0500, Christopher Wright <dhasenan@gmail.com> wrote:

>CLXX wrote:
>> I found some private attributes is not working.
>
>Private imports work if you just do "private import foo;".
>They fail if the import is also static.
>They fail if the import is renamed.
>They fail if the import is selective.
>There is a bugzilla entry for this somewhere.


http://d.puremagic.com/issues/show_bug.cgi?id=314

Gide