scala/scala — pull request #3497 by adriaanm (2014-02-10 05:31:49+00:00)
Title: SI-8129 Make Object#== override Any#==

[This is a rebase of #3464]

And the same for !=

If we tried to declare these signatures in non-fictional classes,
we would be chastised about collapsing into the "same signature after
erasure".

This will have an influence of typing, as the typechecking of
arguments is sensitive to overloading: if multiple variants are
feasible, the argument will be typechecked with a wildcard expected
type. So people inspecting the types of the arguments to `==` before
this change might have seen an interesting type for
`if (true) x else y`, but now the `If` will have type `Any`, as we
don't need to calculate the LUB.

I've left a TODO to note that we should really make `Any#{==, !=}`
non-final and include a final override in `AnyVal`. But I don't think
that is particularly urgent.