D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6991 - Symbol not found when using function-local imports
Summary: Symbol not found when using function-local imports
Status: RESOLVED DUPLICATE of issue 6272
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-22 19:32 UTC by Andrej Mitrovic
Modified: 2011-11-23 09:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2011-11-22 19:32:22 UTC
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 bearophile_hugs 2011-11-23 00:30:52 UTC
See bug 6272
Comment 2 bearophile_hugs 2011-11-23 09:35:47 UTC

*** This issue has been marked as a duplicate of issue 6272 ***