From the documentation, I understand that it is not necessary to use override when supplying equals and toString methods for classes, defining the method is enough, i.e.:
class Thing(argId : Int) {
val id = argId
func equals(other : Any?) : Boolean {
return this.id == other.id
}
}
I also discovered that these methods cannot be supplied as extension methods:
// outside the class… is never called
func Thing.equals(other : Any?) : Boolean {
return this.id == other.id
}
I’m curious, is this the intended behavior?