introspection woes (2)
Robert Clipsham
robert at octarineparrot.com
Mon Jun 13 05:23:41 PDT 2011
On 13/06/2011 13:11, Lloyd Dupont wrote:
> Interesting... I think I understand...
> Thanks! :)
>
> However an other problem arise with getMembers() it always returns null!
> Looking at the code it seems (from my beginner's perspective) that
> getMembers() rely on the member field (function) xgetMembers which is
> always null, as far as I can tell (didn't see any assignment...)
>
> Anyway of ... making the runtime update xgetMembers?
My understanding is that xgetMembers is never filled in due to the
overhead it would add. You can recompile dmd to support it, but that's a
pain. The work around I use is to put a mixin in every class I want to
use which uses compile time reflection to build an array which I can
access at runtime. Not the most elegant solution. Perhap's a bug report
needs opening for this if one isn't already open.
--
Robert
http://octarineparrot.com/
More information about the Digitalmars-d-learn
mailing list