The problem is, that adding two Int16
results in an Int32
as others have already pointed out.
Your second question, why this problem doesn't already occur at the declaration of those two variables is explained here: http://msdn.microsoft.com/en-us/library/ybs77ex4%28v=VS.71%29.aspx:
short x = 32767;
In the preceding declaration, the integer literal 32767 is implicitly converted from int to short. If the integer literal does not fit into a short storage location, a compilation error will occur.
So, the reason why it works in your declaration is simply that the literals provided are known to fit into a short
.