[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
Wed Jan 20 14:37:34 UTC 2021


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

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

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

--- Comment #3 from RazvanN <razvan.nitu1305 at gmail.com> ---
Imports inside mixin templates should be seen as local to the mixin template.
Even if it is inserted at module level, it doesn't change the fact that its
visibility is restricted to the mixin unit. By using the dot operator, you are
bypassing the import inside the mixin and this is intended behavior. All you
have to do is not use the dot and the code will compile.

As a good practice mixin templates should be self-contained.

I think that this bug report is invalid.

--


More information about the Digitalmars-d-bugs mailing list