[Issue 1878] foreach does not handle integral types appropriately

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 8 02:14:24 PDT 2013


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



--- Comment #4 from Lionello Lunesu <lio+bugzilla at lunesu.com> 2013-09-08 02:14:15 PDT ---
I checked the difference between CondExp (?:) and ForeachRangeStatement. The
former only has a special case when the types of the two expressions are equal.
It would fix foreach(i;ubyte..ubyte) and similar, but would not address the
issue raised by the OP.

It's still worth merging the logic of CondExp with ForeachRangeStatement,
though, if only for predictability. In fact, a?0:ubyte should similarly not
evaluate to 'int' but to 'ubyte', for the exact same reasons.

https://github.com/D-Programming-Language/dmd/pull/2538

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