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; ?
*** This issue has been marked as a duplicate of issue 7494 ***