Is there any way to compare two objects like with JAVA Comparable?
val o1: Any
val o2: Any
I know they are the same class and implement JAVA Comparable. If I cast them to JAVA Comparable I get warning I should use Kotlin Comparable, but Kotlin version needs Type which is not known at compile time. All I need is something like this:
val result = (o1 as Comparable).compareTo(o2)