Can kotlin interface detects, on which class is attached to, on its own?
I have generic interface…
interface Parent {
fun function(entity: T): Int
}
And when I implement functionality with some child class…
class Other : Parent {
override fun function(entity: Other): Int {
return 42
}
}
I’m bothered with the fact that I have to pass the same class type while implementing the interface… I would really like for the interface to be able to detect on which class is attached on its own without me providing the same type again…
I would like code...