Andrei Alexandrescu wrote: > On 10/9/11 2:26 AM, Christian Kamm wrote: >> Andrei Alexandrescu wrote: >> >>> On 10/8/11 3:34 PM, Dmitry Olshansky wrote: >>>> I've found out what caused my builds to break. The thing is that both >>>> std.file& std.stdio use fully qualified std.c.stdio.func calls but >>>> never actually import std.c.stdio in any way. I wasn't even aware >>>> that's possible. >>> >>> That may be a bug in the compiler. A symbol shouldn't be visible unless >>> e.g. publicly imported from an imported module (could that be the case)? >> >> It's definitely a bug. Once an import is processed, the package is >> visible globally as long as the parent package is accessible. This >> compiles: >> >> touch dmd2/src/phobos/std/empty.d >> >> a.d: >> import std.stdio; >> >> b.d: >> import std.empty; >> void main() { std.stdio.writeln("hi!"); } > > Hm, this is important. But what is the contribution of a.d to the > example? Do you compile it together with b.d?
Yes, 'dmd b.d' fails, 'dmd a.d b.d' succeeds.