Ruckus
05/08/2019, 1:30 PMexpect class Grade : Comparable<Grade> {
val rough: Int
val fine: Int
// Apparently I can't implement this here
override fun compareTo(other: Grade) {
var result = rough.compareTo(other.rough)
if (result == 0) result = fine.compareTo(other.fine)
return result
}
}
russhwolf
05/08/2019, 1:34 PMexpect class Grade : GradeInterface
where GradeInterface
has your default implementationsrusshwolf
05/08/2019, 1:35 PMcompareTo
. you could do and extension function operater fun Grade.compareTo()
Ruckus
05/08/2019, 1:40 PMrusshwolf
05/08/2019, 1:44 PM