Hullaballoonatic
12/01/2019, 10:26 PMiterface Foo : Comparable<Bar> {
override fun equals(other: Any?) = when (other) {
is Comparable<*> -> // other is Comparable<Bar> && (other as Comparable<Bar>).compareTo(this) == 0
else -> false
}
}
cast as and try/catch?Dominaezzz
12/01/2019, 10:31 PMis Foo ? 😛karelpeeters
12/01/2019, 10:31 PMkarelpeeters
12/01/2019, 10:32 PMequals implementation there.Hullaballoonatic
12/01/2019, 10:32 PMHullaballoonatic
12/01/2019, 10:33 PMFoo isn't the only thing implementing Comparable<Bar>Dominaezzz
12/01/2019, 10:36 PM