title: Why do Visual Studio and Resharper fail to recognize this dead code as such?
body: <p>A funny thing happened on the way to my first compilation of the week. I came across this line of code:</p>
  
  <pre><code>if (SetFetchTab)
      tabMain.SelectedIndex = 1;
  </code></pre>
  
  <p>...and decided, well, I'll make that into a const to make it more readable, and enclose it in braces while I'm at it, in case additional code needs to be added to this condition later:</p>
  
  <pre><code>const int FETCH_TAB = 0;
  const int CONNECTION_TAB = 1;
  . . .
  if (SetFetchTab)
  {
      tabMain.SelectedIndex = CONNECTION_TAB;
  }
  </code></pre>
  
  <p>But then curiosity got the  best of me, and I decided to find out where SetFetchTab is assigned a value...it's not -- except implicitly assigned false/0 where it's declared:</p>
  
  <pre><code>public static bool SetFetchTab;
  </code></pre>
  
  <p>At one time, another form conditionally set SetFetchTab to either 0 or 1, but that code is now commented out. SO, the condition above will NEVER be true, and the SelectedIndex will never be assigned CONNECTION_TAB/1. Therefore, why is this block not grayified, signifying it is dead code?</p>
  
  <p>BTW, FETCH_TAB <em>is</em> grayified/recognized as a dead declaration, as tabMain.SelectedIndex is never assigned 0, and thus I had nowhere to use this.</p>