[Issue 17067] D header file generation includes excess imports

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 20 10:40:17 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=17067

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305 at gmail.com

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
This is probably a WONTFIX since the header generation is done immediately
after the parsing phase so at that point no symbol resolution is done to see
which symbols come from which imports and the safe thing to do is to just put
them there; a workaround for this is to use scoped imports :

import std.stdio;

class Foo
{
    void bar()
    {
        import std.stdio : writeln;
        writeln("Hello world!");
    }
}

--


More information about the Digitalmars-d-bugs mailing list