Bug 7622 – Qualified imports inside functions don't work for real
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-03-01T14:19:00Z
Last change time
2012-04-21T06:07:41Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2012-03-01T14:19:31Z
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 by lovelydear — 2012-04-21T06:07:41Z
*** This issue has been marked as a duplicate of issue 7494 ***