Inline variable declaration doesn't compile when using '== false' instead of negation operator : <p>Consider the following snippets:</p>

<pre><code>void Foo(object sender, EventArgs e)
{
    if (!(sender is ComboBox comboBox)) return;
    comboBox.DropDownWidth = 100;
}
</code></pre>

<p>compared to</p>

<pre><code>void Bar(object sender, EventArgs e)
{
    if ((sender is ComboBox comboBox) == false) return;
    comboBox.DropDownWidth = 100;
}
</code></pre>

<p>Code including <code>Foo()</code> successfully compiles in .Net 4.6.1, while code including <code>Bar()</code> results in <code>Use of unassigned local variable 'comboBox'</code>. </p>

<p>Without getting into a debate over the reasons behind using <code>== false</code> instead of the negation operator, can someone explain why one compiles and the other does not?</p>
