https://kotlinlang.org logo
Title
b

birgersp

11/29/2017, 2:18 PM
Can Kotlin implement the same interface (with different generic types) multiple times? After some experiments, I guess not. If that's true, how can I work around it?
k

karelpeeters

11/29/2017, 2:21 PM
No, because at runtime there's no difference between
Consumer<String>
and
Consumer<Int>
, so the methods would collide.
b

birgersp

11/29/2017, 2:25 PM
What's the most professional way to work around this?
k

karelpeeters

11/29/2017, 2:26 PM
The answers on the question you linked all apply to Kotlin as well.