running this gives ["std.stdio"] instead of: ["std.stdio", "std.algorithm", "std.traits"] Is that intended? bug? also it's in fact in ModuleInfo.Old so is that deprecated? If so it should be marked as such. How else to get same functionality? ---- module bugs.bug_2013_04_24_19_55_21; import std.algorithm; import std.stdio; import std.traits; void main(){ foreach(a; ModuleInfo) { if(a.name!=moduleName!a) continue; auto b=a.importedModules; writeln(b.map!`a.name`); } } ----
Up to 2.062 : Success with output: ["std.stdio"] 2.063 to 2.064 : Success with output: ["std.algorithm", "std.stdio", "std.traits"] 2.065.0: Success with output: ["std.stdio"] 2.066.0: Success with output: ["std.algorithm", "std.stdio", "std.traits"] 2.067.1 to 2.074.1: Success with output: ["std.stdio"] Since 2.075.1: Success with output: [] Regression?..
importedModules is emitted based upon need. It is used for module constructors being called in the right order. The output right now is: ``` ["std.array", "core.memory", "core.internal.array.utils"] ``` Unfortunately, you cannot use this for reflection purposes, as ModuleInfo is not always emitted (its bloat usually).