Local imports appear in the grammar, but their semantics is unspecified. For example, DMD lets local imports hide local variables:
void main(){
string[string] map;
pragma(msg, typeof(map)); // "string[string]"
{
import std.algorithm;
pragma(msg, typeof(map)); // "void"
}
}
But the documentation does not say if this is valid or if it is a bug.
Comment #1 by mk — 2013-06-16T10:45:23Z
*** Issue 10378 has been marked as a duplicate of this issue. ***
Comment #2 by andrej.mitrovich — 2014-04-23T12:19:19Z
They are now documented as "Scoped Imports" in http://dlang.org/module.html, including that they hide outer symbols.