On Wednesday, 13 November 2013 at 00:25:36 UTC, Andrei Alexandrescu wrote:
I don't think all classes in a system are discoverable during compilation. This is the part of Object.factory that is not easy to replace. There must be a global map somewhere and a per-module registration during initialization.

Andrei

Sure, this topic was already discussed in __traits(getUnittest) context recently, similar problem. You can find all classes that transitively accessible from context via imports - this is a natural limitation of compile-time reflection. Sometimes it is enough, sometimes registration is necessary. But it is a nice tool to have.

Reply via email to