[dmd-internals] Why are there suddenly tons of deprecation messages about imports in Phobos?

David Nadlinger via dmd-internals dmd-internals at puremagic.com
Mon Feb 22 12:53:53 PST 2016


On 22 Feb 2016, at 16:56, Jonathan M Davis via dmd-internals wrote:
> In that case, using static imports makes sense. They're there to avoid 
> name
> conflicts when importing a module. But having a symbol be usable and 
> yet not
> being able to use its FQN is just plain weird.

I wouldn't say it's weird at all. Selective imports conceptually act 
like an alias for the symbol in your local scope. Accordingly, the FQN 
of the symbol is "where that alias is":

---
module test;
import std.stdio : writeln;
void main() { test.writeln("foo"); }
---

  — David


More information about the dmd-internals mailing list