Bug 7329 – local imports are underdocumented

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-20T11:59:00Z
Last change time
2014-04-23T12:19:19Z
Assigned to
nobody
Creator
timon.gehr

Comments

Comment #0 by timon.gehr — 2012-01-20T11:59:23Z
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.