[Issue 16584] Local import ineffective for mixin templates

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16584

--- Comment #2 from m.bier...@lostmoment.com ---
For the record: the best solution is to import the needed modules within the
mixin:

mixin template bla(string number) {
import func;
uint globalBla = toNumber(number);
}

This keeps within the scope of the mixin body.

--


[Issue 16584] Local import ineffective for mixin templates

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16584

m.bier...@lostmoment.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from m.bier...@lostmoment.com ---
>From the documentation:
"Unlike a template instantiation, a template mixin's body is evaluated within
the scope where the mixin appears, not where the template declaration is
defined."

So this is actually by design. Closed the issue.

--