Bug 10531 – Enum base type not inferred from initializer of first member

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-03T10:34:00Z
Last change time
2013-07-03T10:43:05Z
Assigned to
nobody
Creator
timon.gehr

Comments

Comment #0 by timon.gehr — 2013-07-03T10:34:47Z
http://dlang.org/enum.html states: If the EnumBaseType is not explicitly set, and the first EnumMember has an initializer, it is set to the type of that initializer. Otherwise, it defaults to type int. However: enum E{x=""} Error: cannot implicitly convert expression ("") of type string to int
Comment #1 by andrej.mitrovich — 2013-07-03T10:43:05Z
This was fixed in git-head recently. *** This issue has been marked as a duplicate of issue 3096 ***