[Issue 16423] ModuleInfo missing when linking to static lib with classes

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Oct 11 06:43:10 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16423

--- Comment #8 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Whether we need it or not, it's currently a feature of the runtime. Do we not
care about existing code anymore?

I'm totally in favor of deprecating Object.factory, and also in favor of your
update to std.encoding that makes this issue moot for phobos at least. But
there may be code out there which expects Object.factory to work, and in some
cases, it will not.

Note, that in the example I give, including the module info does little to
increase the binary size. The ClassInfo is already present in the binary, and
therefore pulls in everything else the class may use.

Not only that, but building with the -lib switch does not work, but building
without does. This kind of inconsistency is not good for D, regardless of the
utility of the Object.factory feature. It makes no sense that the compiler is
"stupider" about trimming fat when it has full code access than the linker.

--


More information about the Digitalmars-d-bugs mailing list