title: Why is an explicit conversion required after checking for null?
body: <pre><code>int foo;
  int? bar;
  
  if (bar != null)
  {
      foo = bar; // does not compile
      foo = (int)bar; // compiles
      foo = bar.Value; // compiles
  }
  </code></pre>
  
  <p>I've known for a long time that the first statement is incorrect, but it has always bugged me. I've verified that <code>bar</code> is not null, so why does the compiler complain?</p>