digitalmars.D.learn - does "private import" means "static import" to other modules importing it?
- Cheng Wei (8/8) Oct 13 2011 suppose we have in module A, we have
- Andrej Mitrovic (19/19) Oct 13 2011 You can always qualify the full name unless you're importing a
- Jesse Phillips (4/6) Oct 13 2011 No, I'm pretty sure it is just a bug, and one that was recently discusse...
- Andrej Mitrovic (2/8) Oct 14 2011 Woops, sorry for the slip-up.
- Nick Sabalausky (3/4) Oct 13 2011 It's not supposed to, but it does at the moment due to a bug.
suppose we have in module A, we have import B; Then in module C; import A; B.fun1(); B.fun2(); can be compiled successfully even without "static import B". Is this correct? Thanks.
Oct 13 2011
You can always qualify the full name unless you're importing a specific symbol, e.g.: module A; import B : fun1; module C; import A; fun1(); // ok B.fun1(); // not ok B.fun2(); // not ok static import just means you can't use the symbol without qualifying the full package/module name before it: module A; static import B; module C; import A; B.fun1(); // ok B.fun2(); // ok fun1(); // not ok I think that should be it.
Oct 13 2011
On Thu, 13 Oct 2011 16:21:56 +0200, Andrej Mitrovic wrote:You can always qualify the full name unless you're importing a specific symbol, e.g.:No, I'm pretty sure it is just a bug, and one that was recently discussed too. Private imports should not expose their symbols to other modules even if you use a fully qualified name.
Oct 13 2011
On 10/14/11, Jesse Phillips <jessekphillips+d gmail.com> wrote:On Thu, 13 Oct 2011 16:21:56 +0200, Andrej Mitrovic wrote:Woops, sorry for the slip-up.You can always qualify the full name unless you're importing a specific symbol, e.g.:No, I'm pretty sure it is just a bug, and one that was recently discussed too. Private imports should not expose their symbols to other modules even if you use a fully qualified name.
Oct 14 2011
"Cheng Wei" <rivercheng gmail.com> wrote in message news:j76dc6$1fcu$1 digitalmars.com...does "private import" means "static import" to other modules importing it?It's not supposed to, but it does at the moment due to a bug.
Oct 13 2011