Bug 6991 – Symbol not found when using function-local imports
Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-11-22T19:32:00Z
Last change time
2011-11-23T09:35:47Z
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2011-11-22T19:32:22Z
import std.stdio;
// import std.cpuid : threadsPerCPU; // ok
void main()
{
import std.cpuid : threadsPerCPU;
writeln(threadsPerCPU); // NG, undefined identifier threadsPerCPU
}
It doesn't complain about the import, but only when used in a function call, and only if it's imported within the function.
Comment #1 by bearophile_hugs — 2011-11-23T00:30:52Z
See bug 6272
Comment #2 by bearophile_hugs — 2011-11-23T09:35:47Z
*** This issue has been marked as a duplicate of issue 6272 ***