The declaration of your interface requires that
V extends MvpViewV (exactly V , not its subtype) is used as a general parameter for P extends MvpPresenter<V>
Given that you cannot extend ActivityMvpDelegate<MvpView, MvpPresenter<V>> , because there is no guarantee that V is exactly MvpView (also, in Kotlin, common parameters are not implicitly inherited, you need to redo them as class SomeClass<T> : SomeInterface<T> ).
You can, however, write it as
class MyActivityDelegate(private val activity: Activity) : ActivityMvpDelegate<MvpView, MvpPresenter<MvpView>>
or enter another general parameter, so that V and the argument for P still the same:
class MyActivityDelegate<T : MvpView>(private val activity: Activity) : ActivityMvpDelegate<T, MvpPresenter<T>>
You can also change the general declaration of your interface from P extends MvpPresenter<V> to P extends MvpPresenter<? extends V> P extends MvpPresenter<? extends V> (or use out V in Kotlin), and you can use any subtype V as an argument, including a limited pedigree:
class MyActivityDelegate<T : MvpView>(private val activity: Activity) : ActivityMvpDelegate<MvpView, MvpPresenter<T>>
source share