Bug 4518 – to!string(enum w/invalid value) produces a somewhat unhelpful error

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-07-27T01:24:00Z
Last change time
2010-09-14T01:13:51Z
Keywords
diagnostic
Assigned to
rsinfu
Creator
braddr

Comments

Comment #0 by braddr — 2010-07-27T01:24:41Z
I don't have a quick repro demo yet, but the result is this: std.conv.ConvError: There is no corresponding enum member name in const(myEnum) It would be very nice to add the actual value encountered. Quick incomplete/untested mockup: enum A { a = 1 } writef("%s", cast(A)2);
Comment #1 by braddr — 2010-09-14T01:13:51Z