title: Why is this generic assignment illegal?
body: <p>I have a class:</p>
  <pre><code>class Generic&lt;T&gt; {
      List&lt;List&lt;T&gt;&gt; getList() {
          return null;
      }
  }
  </code></pre>
  <p>When I declare a <code>Generic</code> with wildcard and call <code>getList</code> method, the following assignment is illegal.</p>
  <pre><code>Generic&lt;? extends Number&gt; tt = null;
  List&lt;List&lt;? extends Number&gt;&gt; list = tt.getList(); // this line gives compile error
  </code></pre>
  <p>This seems odd to me because according to the declaration of <code>Generic</code>, it's natural to create a <code>Generic&lt;T&gt;</code> and get a <code>List&lt;List&lt;T&gt;&gt;</code> when call <code>getList</code>.</p>
  <p>In fact, it require me to write assignment like this:</p>
  <pre><code>List&lt;? extends List&lt;? extends Number&gt;&gt; list = tt.getList(); // this one is correct
  </code></pre>
  <p>I want to know why the first one is illegal and why the second one is legal.</p>
  <p>The example I give is just some sample code to illustrate the problem, you don't have to care about their meaning.</p>
  <p>The error message:</p>
  <blockquote>
  <p>Incompatable types:<br />
  required : <code>List&lt;java.util.List&lt;? extends java.lang.Number&gt;&gt;</code><br />
  found: <code>List&lt;java.util.List&lt;capture&lt;? extends java.lang.Number&gt;&gt;&gt;</code></p>
  </blockquote>