https://kotlinlang.org logo
Title
k

karelpeeters

12/09/2018, 9:25 AM
You want to implement
V
, an type not known at compile time?
r

Rishabh Harit

12/09/2018, 9:26 AM
Yes, it would make my Mvp implementation a bit simpler
But I see your point
k

karelpeeters

12/09/2018, 9:27 AM
But you logically can't do that, what if whatever
V
ends up doing adds some more functions to implement?
r

Rishabh Harit

12/09/2018, 9:28 AM
BaseActivity
is anyways abstract. Shouldn’t that be the responsibility of the concrete class.
a

Andreas Sinz

12/09/2018, 9:57 AM
what about
inline <reified V: BaseView> MyActivity() {
    return object : BaseActivity<V, P> {
          //What methods does `V` have?
     }
That's the first problem. The second one is that you can't tell the compiler that
V
must be either an interface or an open class, because if you use a final class as
V
, the whole thing doesn't work too (can't inherit from a final class)