title: Kotlin Wildcard Capture on List Callback Parameter
body: <p>Java: </p>
  
  <pre><code>public class JavaClass implements ModelController.Callback {
  
      @Override
      public void onModelsLoaded(@NonNull List&lt;? extends Model&gt; models) {
          doSomething(models);
      }
  
      private void doSomething(List&lt;Model&gt; models) { }
  
  }
  </code></pre>
  
  <p>Kotlin:</p>
  
  <pre><code>class ModelController {
      var callback = WeakReference&lt;Callback&gt;(null)
  
      interface Callback {
          fun onModelsLoaded(models: List&lt;Model&gt;)
      }
  
      fun someFunction() {
          callback.get().onModelsLoaded(ArrayList&lt;Model&gt;())
      }
  }
  
  interface Model {
  
  }
  </code></pre>
  
  <p>Without the ? extends Model in the Java onModelsLoaded method, the override doesn’t match the interface made in Kotlin. With it, I get the following error:</p>
  
  <pre><code>doSomething(&lt;java.util.List&lt;com.yada.Model&gt;) cannot be applied to (java.util.List&lt;capture&lt;? extends com.yada.Model&gt;&gt;)
  </code></pre>
  
  <p>Why is the wildcard capture required and why doesn't it allow it to be used against the non-wildcard method?</p>