jstuyts-squins
09/21/2017, 6:20 AMequals(Any?)
. So if you do this, the compiler will pick equals(Value)
because it is more specific:
val x = Value(1)
val y = Value(2)
println(x.equals(y))
But in Kotlin, the ==
operator is implemented using operator function equals(Any?)
, so it will not look for other functions. You can still use the same syntax as in Java though, and then it will work