Why should everything be promoted to long ? The specification (section 7.8.5) lists four operators for integer subtraction:
int operator-(int x, int y);uint operator-(uint x, uint y);long operator-(long x, long y);ulong operator-(ulong x, ulong y);
Given that the constant value 0 implicitly converted to uint , but the value uint ui implicitly converted to int , the second operator is selected in accordance with the steps for resolving overloading of binary operators described in section 7.3.4.
(Is it possible that you did not know about the implicit conversion of constant expressions from 0 to uint and that this was the confusing part? For more details see section 6.1.9 of the C # 4 specification.)
The next section 7.3.4 (which then refers to 7.3.5 and 7.5.3) is a little tortuous, but I believe that it is clearly defined and not at all ambiguous.
If this overflow that bothers you would expect this to not work either?
int x = 10; int y = int.MaxValue - 5; int z = x + y;
If not, what's the difference here?
source share