[Issue 10555] enumerator can no longer increment beyond maximum of initializer
http://d.puremagic.com/issues/show_bug.cgi?id=10555 Kenji Hara changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #5 from Kenji Hara 2013-10-01 23:13:04 PDT --- I agree with Henning Pohl. The behavior in 2.063/earlier was an accepts-invalid bug, and it has been correctly fixed in git-head. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 10555] enumerator can no longer increment beyond maximum of initializer
http://d.puremagic.com/issues/show_bug.cgi?id=10555 --- Comment #4 from Henning Pohl 2013-08-31 04:23:52 PDT --- Keep in mind that you can always cast to the base type: enum A // int { A0 } template BaseType(E) { static if (is(E e == enum)) { alias BaseType = e; } else { static assert("not an enum"); } } enum B // int { B0 = cast(BaseType!A)A.A0, B1 } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 10555] enumerator can no longer increment beyond maximum of initializer
http://d.puremagic.com/issues/show_bug.cgi?id=10555 Henning Pohl changed: What|Removed |Added CC||henn...@still-hidden.de --- Comment #3 from Henning Pohl 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: ---
[Issue 10555] enumerator can no longer increment beyond maximum of initializer
http://d.puremagic.com/issues/show_bug.cgi?id=10555 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment #2 from hst...@quickfur.ath.cx 2013-08-30 11:02:19 PDT --- git bisect shows that the offending commit was 88ebe192d605bd8d4b5768e8a2500f54d73fb5fd - fix issue 3096 - EnumBaseType -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 10555] enumerator can no longer increment beyond maximum of initializer
http://d.puremagic.com/issues/show_bug.cgi?id=10555 Andrej Mitrovic changed: What|Removed |Added CC||andrej.mitrov...@gmail.com --- Comment #1 from Andrej Mitrovic 2013-07-10 08:16:59 PDT --- Well if anything, the recent enum fixes and subsequent regressions exposed that we have a really poor enum test-suite. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---