ModuleInfo, factories, and unittesting

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 19 09:11:38 PST 2016


On Monday, 19 December 2016 at 17:04:43 UTC, Atila Neves wrote:
> Nope, no magic. Just ModuleInfo.opApply in object.d.

Well, it is kinda magical because combining all the ModuleInfo 
takes some tricks from the linker. This method works with 
separate compilation, whereas the compile time tricks don't... 
and that's important to remember in any rewriting situations.

Looping over the modules, all of them, including from separately 
compiled libraries, is necessary for static ctors, dtors, tests, 
and other things. Any replacement needs to keep that in mind 
somehow.

The good news is we might be able to push it off onto the C 
runtime, if the order is done right. I'm not sure though.


More information about the Digitalmars-d mailing list