On Tuesday, 10 October 2017 at 19:55:36 UTC, Chirs Forest wrote:
Why?

D inherited a silly rule from C where any arithmetic is promoted to int first.

The big difference is D doesn't do implicit narrowing conversion... so x + 1 becomes int, but then int to byte requires an explicit cast (unless the compiler can prove the range in that particular expression - this is called "value range propagation").

I think it has proved to be a bit of a mistake :(

Reply via email to