D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7622 - Qualified imports inside functions don't work for real
Summary: Qualified imports inside functions don't work for real
Status: RESOLVED DUPLICATE of issue 7494
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2012-03-01 14:19 UTC by bearophile_hugs
Modified: 2012-04-21 06:07 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 bearophile_hugs 2012-03-01 14:19:31 UTC
This is almost a regression, this used to work, for a short time.

In DMD 2.059head this compiles with no errors, so it looks like qualified imports are allowed inside functions:


void main() {
    import std.stdio: writeln;
}



But it seems you can't use them:

void main() {
    import std.stdio: writeln;
    writeln("hello");
}


test.d(3): Error: 'writeln' is not defined, perhaps you need to import std.stdio; ?
Comment 1 SomeDude 2012-04-21 06:07:41 UTC

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