Don’t Checked and Unchecked establish an overflow context only during runtime?
<pre><code>int int1;
byte byte1;

unchecked
{
    int1 = 2147483647 + 10; //ok
    byte1 = 200+100; //error
}
</code></pre>

<p>1)Only difference between <code>int1</code> and <code>byte1</code> overflows is that the latter happened during narrowing conversion attempt, but the end result ( overflowing ) is the same, so why doesn't compiler also ignore <code>byte1</code> overflow ( I'm aware that compiler allows constant expressions of type <code>int</code> to be converted to smaller type only if the  value is within the range of the target type, but I would expect compiler to ignore such overflows if they happened inside unchecked context)?</p>

<p>2) Aren’t checked and unchecked operators/statements only “active” during runtime (ie don’t they establish overflow checking context only during runtime)? If so, then in above code compiler should also report an error when <code>int1</code> overflowed, since constant expressions are inspected during compile time, and at that point unchecked statement is not yet “active” and thus it won’t yet establish unchecked  overflow context?1</p>

<p>thank you</p>
