title: Kotlin function required Nothing but defined as a different type
body: <p>I've defined a class like so </p>
  
  <pre><code>abstract class MvpViewHolder&lt;P&gt;(itemView: View) : RecyclerView.ViewHolder(itemView) where P : BasePresenter&lt;out Any?, out Any?&gt; {
      protected var presenter: P? = null
  
      fun bindPresenter(presenter: P): Unit {
          this.presenter = presenter
          presenter.bindView(itemView)
      }
  }
  </code></pre>
  
  <p>where <code>presenter.bindView(itemView)</code> gives me an error stating <code>Type mismatch, required: Nothing, found: View!</code>. I've defined the <code>bindView</code> inside the <code>presenter</code> class like so</p>
  
  <pre><code>abstract class BasePresenter&lt;M, V&gt; {
       var view: WeakReference&lt;V&gt;? = null
       var model: M? = null
  
       fun bindView(view: V) {
          this.view = WeakReference(view)
      }
  }
  </code></pre>
  
  <p>It is taking in a value of <code>view: V</code>.</p>
  
  <p>I've tried defining my extension of <code>BasePresenter&lt;out Any?, out Any?&gt;</code> using the star syntaxt <code>BasePresenter&lt;*,*&gt;</code> but I get the same error. I've also tried using just simply <code>BasePresenter&lt;Any?, Any?&gt;</code> which fixes the direct problem, but then anything that is extending <code>P: BasePresenter&lt;Any?, Any?&gt;</code> Gives an error saying that it was expecting P, but got <code>BasePresenter&lt;Any?, Any?&gt;</code></p>
  
  <p>Here is an example where that happens within my code</p>
  
  <pre><code>abstract class MvpRecyclerListAdapter&lt;M, P : BasePresenter&lt;Any?, Any?&gt;, VH : MvpViewHolder&lt;P&gt;&gt; : MvpRecyclerAdapter&lt;M, P, VH&gt;() {...}
  </code></pre>
  
  <p>On this line, I would get the error mentioned above on the part the extends <code>MvpRecyclerAdapter&lt;M, P, VH&gt;</code></p>
  
  <p>I just can't seem to get around this. How can I fix it?</p>