V Thu, 14 Jan 2016 14:25:43 +0000
Byron Heads via Digitalmars-d <[email protected]> napsáno:
> I got burned by this yesterday, this code should not compile
>
> import std.experimental.logger : trace;
>
>
> void foo() {
> import std.net.curl : trace;
> trace("hello");
> }
>
>
> void main() {
> foo();
> }
>
>
> Not sure if this is a duplicate
> https://issues.dlang.org/show_bug.cgi?id=15567
>
>
>
No this is OK, there is no reason to not compile.
It is same as:
import std.stdio;
string trace = "trace";
void foo() {
int trace = 7;
writeln(trace);
}
void main() {
foo();
writeln(trace);
}
local symbols can hide global symbols