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 PMequals
implementation there.Hullaballoonatic
12/01/2019, 10:32 PMFoo
isn't the only thing implementing Comparable<Bar>
Dominaezzz
12/01/2019, 10:36 PM