On Sunday, 22 February 2015 at 14:18:24 UTC, Peter Alexander wrote:
If VRP is unknown then it should be disallowed for precisely that reason! It can't implicitly cast back to a byte, so it shouldn't. If you know that the int fits in a byte then do the cast yourself, that's what it's for.

Question though, how do you physically write the cast for:

byte a;
a += 1;

With a + 1, you can cast that whole right hand side. But with +=1, there's nowhere to put the cast! If you cast(byte) 1, it changes nothing, since it could still overflow.

Reply via email to