[Issue 10951] EnumMembers returns duplicate members for enums

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 2 07:13:02 PDT 2013


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


monarchdodra at gmail.com changed:

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


--- Comment #1 from monarchdodra at gmail.com 2013-09-02 07:13:01 PDT ---
The root issue appears to be that enums can have identifiers with duplicate
values:

//----
writefln("%(%d\n%)", [EnumMembers!SocketOption]);
//----
1
32
4
128
256
4097
4098
16
4101
4102
4103
8
2
4100
4099
4104
1 //HERE
4 //HERE
9
11
10
12
13
27
//----

So I'm not entirely sure EnumMembers is actually at fault here. It's the enum
to string conversion that is "breaking". But at the same time, there are too
enum members with the same value, so I'm not sure this is fixable. At best,
documented and worked around.

-- 
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