I want to declare a function with a generic type which has to inherit from another generic type that should be an interface, and some other class. But Kotlin complains and doesn't let me do this.
class SomeClass<T: SomeInterface> {
fun <R>someFunktion(task: R) where R : SomeOtherClass, R : T {}
}
If I just replace the generic type T in the function declaration with SomeInterface, it works.
class SomeClass<T: SomeInterface> {
fun <R>someFunktion(task: R) where R : SomeOtherClass, R : SomeInterface {}
}
So it seems the problem is that Kotlin does not know whether T is an interface or a class. If it would be a class it could not work because Kotlin does not support multi inheritance for classes.
So does someone know a solution? Thank you already in advance for every effort.