Readonly local variable cannot be used as an assignment target
<p>If I have:</p>

<pre><code>var myObjects = new ConcurrentBag&lt;object&gt;();
</code></pre>

<p>And try to remove objects via:</p>

<pre><code>foreach (var myObject in myObjects.ToArray())
{
    myObjects.TryTake(out myObject);
}
</code></pre>

<p>The compiler complains with: "Readonly local variable cannot be used as an assignment target"</p>

<p>Yet, if I add a local reference within the foreach it compiles:</p>

<pre><code>foreach (var myObject in myObjects.ToArray())
{
    var localReference = myObject;
    myObjects.TryTake(out localReference);
}
</code></pre>

<p>What exactly is going on here?</p>
