title: Nullable types and the ternary operator: why is `? 10 : null` forbidden?
body: <p>I just came across a weird error:</p>
  
  <pre><code>private bool GetBoolValue()
  {
      //Do some logic and return true or false
  }
  </code></pre>
  
  <p>Then, in another method, something like this:</p>
  
  <pre><code>int? x = GetBoolValue() ? 10 : null;
  </code></pre>
  
  <p>Simple, if the method returns true, assign 10 to the Nullable<code>int</code> x. Otherwise, assign null to the <strong>nullable</strong> int. However, the compiler complains:</p>
  
  <blockquote>
    <p>Error 1   Type of conditional expression cannot be determined because there is no implicit conversion between <code>int</code> and <code>&lt;null&gt;</code>.</p>
  </blockquote>
  
  <p>Am I going nuts?</p>