title: What is the reason for "Use of unassigned local variable" error?
body: <p>With this code:</p>
  
  <pre><code>bool dataToAdd;
  if (null == _priceComplianceDetailList) return dataToAdd;
  </code></pre>
  
  <p>I was getting a compiler error, "<em>Use of unassigned local variable 'dataToAdd'</em>"</p>
  
  <p>So I had to explicitly assign "false" to the bool:</p>
  
  <pre><code>bool dataToAdd = false;
  if (null == _priceComplianceDetailList) return dataToAdd;
  </code></pre>
  
  <p>In context:</p>
  
  <pre><code>private bool PopulateSheetWithDetailData()
  {
      bool dataToAdd = false;
      if (null == _priceComplianceDetailList) return dataToAdd;
      List&lt;PriceComplianceDetail&gt; _sortedDetailList =
      . . .
      return _sortedDetailList.Count &gt; 0;
  }
  </code></pre>
  
  <p>Why is it necessary? Don't bools have a default value of false?</p>