[Issue 2881] x.stringof returns typeof(x).stringof when x is an enum

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 29 01:44:57 PDT 2010


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



--- Comment #4 from nfxjfg at gmail.com 2010-04-29 01:42:30 PDT ---
If you just want to get the member names of a struct, there's an easy work
around: use SomeStructType.tupleof.stringof and parse the result. Some strange
inconsistency makes dmd use the actual member name even if the member's type is
an enum.

Sadly, this makes parsing the .stringof result even more hacky and non-trivial
than without bug 2881.

(If you use SomeStructType.tupleof[idx].stringof, when idx is the index of a
member of an enum type, bug 2881 will make dmd to return the type name instead
of the member name.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list