title: C# is operator with nullable types always false according to ReSharper
body: <p>I'm attempting to convert an <code>object</code> to a <code>bool</code> type and want to convert <code>bool</code> and <code>Nullable&lt;bool&gt;</code> types. I also want to make sure I make the appropriate casts where possible. So I have the following code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>if (value is bool)
  {
      boolValue = (bool) value;
  }
  else if (value is bool? &amp;&amp; ((bool?)value).HasValue)
  {
      boolValue = ((bool?) value).Value;
  }
  else
  {
      throw new ArgumentException("Value must be a boolean type");
  }
  </code></pre>
  
  <p>ReSharper 2016 informs me that <code>value is bool?</code> will always evaluate to false in this stack of if statements. Why is that? That would imply that <code>Nullable&lt;bool&gt;</code> doesn't inherit from <code>object</code> (impossible) or that <code>value is bool</code> will capture a <code>bool?</code>.</p>
  
  <p>It's also possible that ReSharper 2016 has a bug; I see that the implementation of <code>System.Windows.Controls.BooleanToVisibilityConverter.Convert</code> is pretty much identical. I doubt that WPF core would have such a mistake in it, leading me to believe it's an issue with ReSharper.</p>