title: Kotlin: Type mismatch (RecyclerView.Adapter<RecyclerView.ViewHolder>)
body: <p>I'm pretty new using Kotlin, I tried to port my project from java to kotlin. Basically, I have a helper class that try to init recyclerview layout, adapter and so on.</p>
  
  <p>In java:
  Adapter</p>
  
  <pre class="lang-java prettyprint-override"><code>public class MyAdapter extends RecyclerView.Adapter&lt;MyAdapter.ViewHolder&gt;
  {
    ...
    public static class ViewHolder extends RecyclerView.ViewHolder
    {
      ...
    }
    ...
  }
  </code></pre>
  
  <p>my helper function:</p>
  
  <pre class="lang-java prettyprint-override"><code>public void init(RecyclerView recyclerView, boolean horizontal, boolean divider, RecyclerView.Adapter adapter, Context context)
  </code></pre>
  
  <p>When I created the adapter and call the function, it works fine.</p>
  
  <p>But in Kotlin:
  Adapter</p>
  
  <pre class="lang-java prettyprint-override"><code>class MyAdapter(...) : RecyclerView.Adapter&lt;MyAdapter.ViewHolder&gt;() {
    ...
    inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
      ...
    }
    ...
  }
  </code></pre>
  
  <p>helper function</p>
  
  <pre class="lang-java prettyprint-override"><code>fun init(recyclerView : RecyclerView, horizontal: Boolean, divider: Boolean, adapter: RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt;, context: Context) {
    ...
  }
  </code></pre>
  
  <p>when I created the adapter and call the function</p>
  
  <pre class="lang-java prettyprint-override"><code>val myAdapter = MyAdapter(...)
  helper.init(listView, false, false, myAdapter, this)
  </code></pre>
  
  <p>I got mismatch error where it required: <code>RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt;</code> and found: <code>MyAdapter</code></p>
  
  <p>Inheritance wise, it should work right? or did I miss something?</p>
  
  <p>Thanks!</p>