http://d.puremagic.com/issues/show_bug.cgi?id=10555
Henning Pohl <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #3 from Henning Pohl <[email protected]> 2013-08-31 04:16:03 PDT --- I think this behaviour is correct: Spec: ---- 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. Named enum members may not have individual Types. A named enum member can be implicitly cast to its EnumBaseType, but EnumBaseType types cannot be implicitly cast to an enum type. ---- The behaviour before issue 3096 always used int as EnumBaseType even though there is a first initializer. enum A // int { A0 } enum B // A { B0 = A.A0, B1 } In this case the base type of B is A and A does not have a member whith a value of 1. enum A // int { A0 } enum B // A { B0 = A.A0, B1 = A.A0 + 1 } This is basically the same case as above. enum A // int { A0 } enum B // int { B0 = A.A0 + 0, B1 } This works because the type of the first initializer is int. So the base type of B becomes int and ints can be incremented easily. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
