https://issues.dlang.org/show_bug.cgi?id=15907
Ali Cehreli <acehr...@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |acehr...@yahoo.com --- Comment #3 from Ali Cehreli <acehr...@yahoo.com> --- Here is another case with two modules (and with a WORKAROUND): // ----- a.d: mixin template MyMixin(alias MODULE) { shared static this() { initFunc!(mixin(MODULE))(); } } void initFunc(alias MODULE)() { foreach (member; __traits(allMembers, MODULE)) { static if(__traits(hasMember, __traits(getMember, MODULE, member), "someProperty")) { } } } // ----- b.d: import a; mixin MyMixin!__MODULE__; void main() { } getMember inside a.d causes the following warnings: a.d(9): Deprecation: b.object is not visible from module a a.d(9): Deprecation: b.a is not visible from module a Here is a WORKAROUND. Make the following changes in a.d: 1) Convert initFunc to a mixin template 2) Mix it in where it's called 3) Call it after it's mixed in mixin template MyMixin(alias MODULE) { shared static this() { mixin initFunc!(mixin(MODULE)); // (2) initFunc(); // (3) } } mixin template initFunc(alias MODULE) { // (1) void initFunc() { foreach (member; __traits(allMembers, MODULE)) { static if(__traits(hasMember, __traits(getMember, MODULE, member), "someProperty")) { } } } } Ali --