Cast IList to IEnumerable
<p>Code snip 1) does not compile, and I need e.g. to make the cast as in snip 2)
if I for some reason want test declared as it is. But why can't the compiler make that cast, this is e.g. the cast for snip 3)  </p>

<p>1)</p>

<pre><code>static IDictionary&lt;int, IEnumerable&lt;int&gt;&gt; DoStuff()
{
  var test = new Dictionary&lt;int, IList&lt;int&gt;&gt;() { { 1, new List&lt;int&gt;() { 1, 2 } } };
  return test;
}
</code></pre>

<p>2)</p>

<pre><code>static IDictionary&lt;int, IEnumerable&lt;int&gt;&gt; DoStuff()
{
  var test = new Dictionary&lt;int, IList&lt;int&gt;&gt;() { { 1, new List&lt;int&gt;() { 1, 2 } } };
  return test.ToDictionary(item =&gt; item.Key, item =&gt; (IEnumerable&lt;int&gt;)item.Value);
}
</code></pre>

<p>3)</p>

<pre><code>static IEnumerable&lt;int&gt; DoStuff()
{
  var test = new List&lt;int&gt;() { 1, 2 };
  return test;
}
</code></pre>
