[Issue 10378] Prevent local imports from hiding local symbols

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Feb 18 11:23:53 PST 2016


https://issues.dlang.org/show_bug.cgi?id=10378

--- Comment #34 from Steven Schveighoffer <schveiguy at yahoo.com> ---
What I mean is, really Timon's code should be:

string readAndLog(string filename){
    import std.file : readText;
    auto text=readText(filename);
    write(filename," read successfully!\n");
    return text;
}

i.e. only use scoped imports with a qualified list of which symbols you will
use, or use a renamed import.

This prevents any hijacking.

--


More information about the Digitalmars-d-bugs mailing list