title: Kotlin generic bounds
body: <p>I'm trying to port my MVP solution from JAVA to Kotlin and I have a big problem with generics. This is how my JAVA classes look like:</p>
  
  <pre><code>public abstract class BaseActivity&lt;P extends BasePresenter&gt; extends AppCompatActivity implements BaseView 
  
  public abstract class BasePresenter&lt;V extends BaseView&gt;
  
  public interface BaseView 
  </code></pre>
  
  <p>And ported to Kotlin:</p>
  
  <pre><code>abstract class BaseActivity&lt;P : BasePresenter&lt;BaseView&gt;&gt; : AppCompatActivity(), BaseView 
  
  abstract class BasePresenter&lt;V : BaseView&gt; 
  
  interface BaseView
  </code></pre>
  
  <p>And when I'm trying to use </p>
  
  <pre><code>class MainActivity() : MainView, BaseActivity&lt;MainPresenter&gt;() 
  </code></pre>
  
  <p>I'm getting "Type argument is not within its bounds. Expected: <strong>BasePresenter</strong>, <strong>Found MainPresenter</strong>"</p>