[Issue 21539] [REG 2.084] symbols from import inside template mixin cannot be accessed using module scope dot operator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 21 07:30:15 UTC 2021


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

--- Comment #5 from RazvanN <razvan.nitu1305 at gmail.com> ---
(In reply to Steven Schveighoffer from comment #4)
> If I use:
> 
> mixin template T()
> {
>    import std.stdio;
>    alias X = T.File;
> }
> 
> It doesn't work.
> 
> I may have to remove all . scope operators in Phobos to get this to work
> (and instead use FQN).

Another option would be to simply alias the global imports. For example, this
works:

mixin template T()
{
    import std.stdio;
    alias Y = std.stdio;
    aliax X = Y.File;
}

I know that this would require to alias every single import, but it is close in
spirit with the sample that you have given.

Is it ok to close this as INVALID?

--


More information about the Digitalmars-d-bugs mailing list