Why does local variable inside foreach loop conflict with variable declared outside the loop?
<p>Given this code:</p>

<pre><code>List&lt;string&gt; things = new List&lt;string&gt;();

foreach (string thing in things)
{
    string foo = thing.ToUpper();
}

string foo = String.Empty;
</code></pre>

<p>Why does the compiler complain that foo is declared twice? Surely the instance declared in the foreach loop is only valid within the scope of the loop?</p>
