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

Jonathan M Davis via dmd-internals dmd-internals at puremagic.com
Sat Feb 20 16:07:38 PST 2016


What exactly has changed with the import rules? There are now a _ton_ of
deprecation messages being printed out when building phobos which are
talking about static imports. For instance,

std/string.d(5692): Deprecation: module std.utf is not accessible here, perhaps add 'static import std.utf;'

The corresponding line is

    nextt = std.utf.decode(to, i);

And not only is std.utf imported at the beginning of the function, it's
imported explicitly:

    import std.utf : decode;

Does this have something to do with the recent changes to try and deal with
local imports not shadowing stuff? In this particular case, there is no
local variable named decode, and when decode is used, its full import path
is used and not just its name. Is this behavior intended? And what exactly
is going on that the compiler suddenly wants lots of static imports?

- Jonathan M Davis



More information about the dmd-internals mailing list