It appears some parts of an expression may be evaluated at compile-time, while other parts at run-time
<p>Probably a silly question, since I may have already answered my question, but I just want to be sure that I'm not missing something </p>

<p>Constant expressions are evaluated at compile time within checked context. I thought the following expression shouldn't be evaluated at compile time, since I assumed C# considers a particular expression as a constant expression only if all operands on the left-hand side are constants:</p>

<pre><code>int i= 100;
long u = (int.MaxValue  + 100 + i); //error
</code></pre>

<p>Instead it appears compiler considers any subexpression where both operands are constants as a constant expression, even if other operands in an expression are non-constants? Thus compiler may only evaluate a part of an expression at compile time, while the remained of the expression ( which contains non-constant values ) will get evaluated at run-time --> I assume in the following example only <code>(200 +100)</code> gets evaluated at compile time</p>

<pre><code>int i=100;
long l = int.MaxValue  + i + ( 200 + 100 ); // works
</code></pre>

<p>Are my assumptions correct?</p>

<p>thanx</p>
