title: Why can't I use AddRange to add subclassed items?
body: <p>I have two classes.... Parcel and FundParcel...and I'm trying to convert an IEnumerable of the subtype to an IList of the supertype....</p>
  
  <pre><code>public class FundParcel : Parcel
  {
    /* properties defined here */
  }
  
  public class Parcel
  {
    /* properties defined here */
  }
  </code></pre>
  
  <p>These are used in another class in a method as follows:</p>
  
  <pre><code>private IList&lt;Parcel&gt; ExtractParcels(IEnumerable&lt;FundParcel&gt; fundParcels)
  {
      var parcels = new List&lt;Parcel&gt;();
  
      foreach (var fp in fundParcels)
          parcels.Add(fp);
  
      return parcels;
  }
  </code></pre>
  
  <p>What I don't understand is why the foreach statement can't be reduced to: </p>
  
  <pre><code>parcels.AddRange(fundParcels);
  </code></pre>
  
  <p>I basically get an error that says "Argument type <code>'System.Colection.Generic.IEnumerable&lt;FundParcel&gt;' is not assignable to parameter type 'System.Collections.Generic.IEnumerable&lt;Parcel&gt;'"</code></p>
  
  <p>But if that's the case then I don't understand why parcels.Add works...</p>
  
  <p>I feel as though the entire method ought to be replaceable with the line:</p>
  
  <pre><code>return (List&lt;Parcel&gt;)fundParcels;
  </code></pre>
  
  <p>...or maybe the method can be scrapped alltogether since subtypes should be substitutable for their supertype..</p>
  
  <p>Can anyone explain what the deal is with AddRange in this case and why the for loop may be necessary in this case?</p>