[Issue 12791] .tupleof does not take base class fields into account

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 29 08:59:09 PDT 2015


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

pabuond at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pabuond at gmail.com

--- Comment #2 from pabuond at gmail.com ---
I have been trying to find a way to dynamically retrieve all the fields of a
derived class (and their value), including of course those of the base class. 

As you say and as described in the doc, `.tupleof` doesn't return fields from
the base class (why?)

Traits only help for static fields, and calling `myclassinstance.super.tupleof`
doesn't work, nor does `myclassinstance.BaseClassName.tupleof` (as suggested in
http://forum.dlang.org/post/mailman.69.1384804905.2552.digitalmars-d-learn@puremagic.com)

Is there any way?

--


More information about the Digitalmars-d-bugs mailing list