[Issue 2484] Templated classes have no moduleinfo

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 15 08:07:44 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2484





------- Comment #1 from dhasenan at gmail.com  2009-02-15 10:07 -------
This is actually an interesting situation.

Most nested types should be fine. Templates are difficult. The ClassInfo is
generated at each instantiation, and the linker takes care of duplicates. But
the compiler can't. So the ClassInfo would have to appear in multiple
ModuleInfos. This isn't a very good situation, and besides, the name of the
variable is localClasses -- the template isn't necessarily instantiated in the
same module in which it is defined. And you can't patch up the object file for
that module to include the generated ClassInfo for the instantiation.

You could have each module have a list of templated classes instantiated in
that module. That seems a bit ugly. You could have that list stored privately
and patch up ModuleInfo.localClasses at runtime, but that could be expensive.


-- 



More information about the Digitalmars-d-bugs mailing list