https://issues.dlang.org/show_bug.cgi?id=14844
--- Comment #1 from Martin Nowak <[email protected]> --- A bit more reduced, but I don't understand enough of the addMember/include/scope part of dmd to fix this. module app; import std.typecons; alias CppNs = Typedef!string; bool runUnitTestsImpl(alias COMPOSITE)() { foreach (M; __traits(allMembers, COMPOSITE)) static if (__traits(compiles, __traits(getMember, COMPOSITE, M)) && !isModule!(__traits(getMember, COMPOSITE, M))) if (runUnitTestsImpl!(__traits(getMember, COMPOSITE, M))) return false; return true; } template isModule(alias DECL) { enum isModule = startsWith(DECL.stringof, "module "); } bool startsWith(Needle)(string doesThisStart, Needle withThis) { return doesThisStart.length >= withThis.length && doesThisStart[0 .. withThis.length] == withThis; } alias run = runUnitTestsImpl!app; --
