title: How to disable generic inheritance for the super class
body: <p>I have a class <code>Foo</code> which has this instance attribute : an object constructed from a class called <code>SuperClass</code>. This <code>SuperClass</code> is the parent of another class, say... <code>SubClass</code>.</p>
  
  <p>In fact, I'm going to be more precise. <code>Foo</code>'s attribute can be anything (generics) but this "anything" has to extend from <code>SuperClass</code>. You can take a look at the code below (it's the translation of what I'm saying).</p>
  
  <pre><code>class Foo&lt;K extends SuperClass&gt; {
     K attr;
  }
  </code></pre>
  
  <p>In fact, <code>K</code> must be a <code>SubClass</code> object. NOT DIRECTLY a <code>SuperClass</code> one.</p>
  
  <p>But I tried, to test, to create a <code>Foo</code> object with <code>K</code> = <code>SuperClass</code>... and it works... <strong>It's the problem.</strong></p>
  
  <p>Well, do you know how to avoid the possibility to create a <code>Foo</code> object using a <code>SuperClass</code> instead of one child please ?</p>