title: List of Generic Wrapper Objects
body: <p>Can anyone tell me why I can't add to a list a wrapper containing generic class that have inheritance ? </p>
  
  <pre><code>public abstract class SectorObject{} 
  public class SpawnPoint : SectorObject
  public class Trigger : SectorObject
  public class SectorObjectList&lt;T&gt;  where T : SectorObject { public List&lt;T&gt; items ; };
  
  
  public List&lt;SectorObjectList&lt;SectorObject&gt;&gt; objectLists = new List&lt;SectorObject&lt; SectorObject&gt;&gt;();
  
  SectorObjectList &lt;SpawnPoint&gt; spawnPoints = new SectorObjectList&lt;SpawnPoint&gt;();
  
  objectLists.Add(spawnPoints);  // This line doesn't work.
  </code></pre>
  
  <p>It works only as this : </p>
  
  <pre><code>public List&lt;SectorObjectList&lt;SpawnPoint&gt;&gt; objectLists = new List&lt;SectorObject&lt; SpawnPoint&gt;&gt;();
  SectorObjectList &lt;SpawnPoint&gt;spawnPoints = new SectorObjectList&lt;SpawnPoint&gt;();
  objectLists.Add(spawnPoints);  
  </code></pre>
  
  <p>Cheers.</p>