title: Type compatibility and LINQ mystery
body: <p>I had a block of code:</p>
  
  <pre><code>List&lt;OneFeat&gt; Feats;
  ...
  List&lt;OneFeat&gt; Results = new List&lt;OneFeat&gt;(0);
  foreach (OneFeat Test in Feats)
      if (String.Compare(Test.Name, Target, true) == 0)
          Results.Add(Test);
  return Results;
  </code></pre>
  
  <p>Resharper offered:</p>
  
  <pre><code>List&lt;OneFeat&gt; Results = new List&lt;OneFeat&gt;(0);
  Results.AddRange(Feats.Where(Feat =&gt; String.Compare(Feat.Name, Target, true) == 0));
  return Results;
  </code></pre>
  
  <p>Which of course worked.  However, it's creating a list and adding it to an empty list so I tried to simplify it to:</p>
  
  <pre><code>return Feats.Where(Feat =&gt; String.Compare(Feat.Name, Target, true) == 0));
  </code></pre>
  
  <p>Which won't compile because it wants a cast.  If I add the cast it fails at runtime.</p>
  
  <p>Is there any way to code this without copying the list of results?</p>