title: ? extends TSubject extends Subject - Not type safe, or just Java can't handle it?
body: <p>When compiling this</p>
  
  <pre><code>import java.util.List;
  
  public class Test {
      public static class Subject {
      }
  
      public static class MySubject extends Subject {
      }
  
      public static class Step&lt;TSubjectA extends Subject&gt; {
          public void doWork(TSubjectA subject) {
          }
      }
  
      public static class Worker {
          public static &lt;TSubjectB extends Subject&gt; void doWork(TSubjectB subject, List&lt;Step&lt;? extends TSubjectB&gt;&gt; steps) {
              for (Step&lt;? extends TSubjectB&gt; step : steps) {
                  step.doWork(subject);
              }
          }
      }
  
      public static void main(String[] args) {
          MySubject subject;
          List&lt;Step&lt;? extends Subject&gt;&gt; steps;
  
          Worker.doWork(subject, steps);
      }
  }
  </code></pre>
  
  <p>I get the error</p>
  
  <blockquote>
    <p>Test.java:18: doWork(capture#95 of ? extends TSubjectB) in Test.Step cannot be applied to (TSubjectB)</p>
  </blockquote>
  
  <p>From what I can see, <code>subject</code> is of type <code>TSubjectB</code>, which extends <code>Subject</code>. The type <code>TSubjectA</code> is a type which extends <code>TSubjectB</code> which extends <code>Subject</code>. So I should be able to pass <code>subject</code> to <code>doWork</code> and it should all be typesafe.</p>
  
  <p>Am I missing something and it is actually not typesafe, or is this just a limitation of Java's generics?</p>