[Issue 3505] [module] static imports should be binded to the leaf module, not the fully qualified name

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 14 09:20:25 PST 2009


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



--- Comment #2 from Leandro Lucarella <llucax at gmail.com> 2009-11-14 09:20:25 PST ---
(In reply to comment #1)
> Maybe something like this could be allowed to mean "import renamed to the
> leaf":
> 
>     import (foo.bar.)MyModule;
> 
> Sometimes I do want the actually fully qualified name, like for a module like
> std.string.  Having "string" mucks with the type "string".  Or maybe parens
> around the part to keep:
> 
>     import foo.bar.(MyModule);

I think it's very unfortunate to have a module with the same name of an almost
built-in type. Maybe the module can be renamed to std.str; or we can live with:

import str = std.string;

Another possibility is, if bug 3503 gets implemented, is to leave static import
untouched. I think that's even a good idea for backwards compatibility.

static import std.string;
import std.algorithm;

std.string.foo();
algorithm.sort();

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list