On 09/21/2014 07:29 AM, deadalnix wrote:
Free goodie: when you import, all symbol are resolved via the expected import resolution mechanism. All ? No, the root package is imported in the local scope. foo(int a) { import a.b.c; // a is now a package and not the parameter a anymore. }
For local imports, DMD imports _all_ symbols into the local scope, shadowing anything that was there, which is plain broken (as Sӧnke's example shows). BTW: how do you suggest to treat the root package? I think importing into the local scope is fine, but the above example should emit an error because the parameter and the package conflict.
(The following code does not compile either: int std; import std.conv;)