diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-04 15:55:59 +0100 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-02-10 10:58:58 -0800 |
commit | 4a8edc03653cb0f6b6ed1cdea1779a19df20f8f5 (patch) | |
tree | a2504af682ddcd74d8050bbf26639b5c58b7c636 /test/files/presentation/ide-bug-1000475.check | |
parent | b0f81ed35a45fffb9d0761299013d9d5f324ade6 (diff) | |
download | scala-4a8edc03653cb0f6b6ed1cdea1779a19df20f8f5.tar.gz scala-4a8edc03653cb0f6b6ed1cdea1779a19df20f8f5.tar.bz2 scala-4a8edc03653cb0f6b6ed1cdea1779a19df20f8f5.zip |
SI-8129 Make Object#== override Any#==
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.
Diffstat (limited to 'test/files/presentation/ide-bug-1000475.check')
-rw-r--r-- | test/files/presentation/ide-bug-1000475.check | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/test/files/presentation/ide-bug-1000475.check b/test/files/presentation/ide-bug-1000475.check index f5b4253e1a..4fb7f18285 100644 --- a/test/files/presentation/ide-bug-1000475.check +++ b/test/files/presentation/ide-bug-1000475.check @@ -3,7 +3,7 @@ reload: Foo.scala askTypeCompletion at Foo.scala(3,7) ================================================================================ [response] askTypeCompletion at (3,7) -retrieved 31 members +retrieved 29 members [inaccessible] protected[package lang] def clone(): Object [inaccessible] protected[package lang] def finalize(): Unit def +(other: String): String @@ -18,10 +18,8 @@ def hashCode(): Int def toString(): String def →[B](y: B): (Object, B) final def !=(x$1: Any): Boolean -final def !=(x$1: AnyRef): Boolean final def ##(): Int final def ==(x$1: Any): Boolean -final def ==(x$1: AnyRef): Boolean final def asInstanceOf[T0]: T0 final def eq(x$1: AnyRef): Boolean final def isInstanceOf[T0]: Boolean @@ -37,7 +35,7 @@ final def wait(x$1: Long,x$2: Int): Unit askTypeCompletion at Foo.scala(6,10) ================================================================================ [response] askTypeCompletion at (6,10) -retrieved 31 members +retrieved 29 members [inaccessible] protected[package lang] def clone(): Object [inaccessible] protected[package lang] def finalize(): Unit def +(other: String): String @@ -52,10 +50,8 @@ def hashCode(): Int def toString(): String def →[B](y: B): (Object, B) final def !=(x$1: Any): Boolean -final def !=(x$1: AnyRef): Boolean final def ##(): Int final def ==(x$1: Any): Boolean -final def ==(x$1: AnyRef): Boolean final def asInstanceOf[T0]: T0 final def eq(x$1: AnyRef): Boolean final def isInstanceOf[T0]: Boolean @@ -71,7 +67,7 @@ final def wait(x$1: Long,x$2: Int): Unit askTypeCompletion at Foo.scala(7,7) ================================================================================ [response] askTypeCompletion at (7,7) -retrieved 31 members +retrieved 29 members [inaccessible] protected[package lang] def clone(): Object [inaccessible] protected[package lang] def finalize(): Unit def +(other: String): String @@ -86,10 +82,8 @@ def hashCode(): Int def toString(): String def →[B](y: B): (Object, B) final def !=(x$1: Any): Boolean -final def !=(x$1: AnyRef): Boolean final def ##(): Int final def ==(x$1: Any): Boolean -final def ==(x$1: AnyRef): Boolean final def asInstanceOf[T0]: T0 final def eq(x$1: AnyRef): Boolean final def isInstanceOf[T0]: Boolean |