[Issue 264] New: No selective static imports

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 22 05:57:40 PDT 2006


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

           Summary: No selective static imports
           Product: D
           Version: 0.163
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: deewiant at gmail.com


I'm not sure if this should be allowed, but it seems to me that the
specification doesn't disallow it:

--
static import std.stdio : writefln;

void main() {
        std.stdio.writefln("bar");
}
--

Currently this doesn't compile, as the import works the same way as it would
without the "static". This is, in a way, understandable, as normal selective
imports leave the imported module's name undefined. I nevertheless feel that
this is a small loss in functionality.

Allowing this might introduce a new issue, however. Consider the following:

--
static import std.stdio : foo = writefln;

void main() {
        std.stdio.foo("bar");
}
--

The above might make it seem as though there is something called foo in the
std.stdio package.


-- 




More information about the Digitalmars-d-bugs mailing list