DMD 2.071.1 and Issue 15925 - [REG 2.071] Import declaration from mixin templates are ignored
Martin Nowak via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jun 30 06:05:58 PDT 2016
On Thursday, 30 June 2016 at 12:20:26 UTC, captaindet wrote:
> this is really bad news for meta programming. i would have to
> do this with ugly string mixins from now on, or is this
> unintended behavior for string mixins as well?
No it's not, importing whole modules or packages into the scope
of a user of your template is fairly problematic, b/c from there
on any change in the imported modules will affect all users.
Use selective imports instead to introduce just the necessary
steps.
In rare cases where the whole module is needed, you can use
string mixins.
For converting existing code you can use -transition import
and/or checkimports.
More information about the Digitalmars-d
mailing list