As far as I understand, Scala's ==
defines the natural equality of two objects.
I expected that Array(0,1,2) == Array(0,1,2)
compares the natural equality. For example, checks if all elements of the array return true when compared with the corresponding elements of the other array.
People told me that Scala's Array
is just a Java []
which only compares identity. Wouldn't it be more meaningful to override Array
'sequals
method to compare natural equality instead?