title: Declaring a variable of generic base type, when inheriting types have different type parameters
body: <p>I have a class hierarchy, which is something like that:</p>
  
  <pre><code>public abstract class BaseDecision 
  {
      // &lt;implementation&gt;
  }
  
  public class CCDecision : BaseDecision 
  {
      // &lt;implementation&gt;
  }
  
  public class UCDecision : BaseDecision  
  {
      // &lt;implementation&gt;
  }
  
  public abstract class BaseInfo&lt;TDecision&gt; where TDecision:BaseDecision, new()
  {
      public TDecision proposedDecision;
      public TDecision finalDecision;
      // &lt;implementation&gt;
  }
  
  public class CCInfo : BaseInfo&lt;CCDecision&gt;
  {
      // &lt;implementation&gt;
  }
  
  public class UCInfo : BaseInfo&lt;UCDecision&gt;
  {
      // &lt;implementation&gt;
  }
  </code></pre>
  
  <p>The problem is, that with such a class hierarchy, I can't declare a variable, which could contain instances of both CCInfo and UCInfo classes (as they use a base type with a different type parameter). As far as I understand - I can't make use of variance either, as my generic parameter is used both for input and for output. </p>
  
  <p>I personally sense some kind of anti-pattern here, but just can't figure out how to solve this.</p>