summaryrefslogtreecommitdiff
path: root/src/library-aux/scala/Any.scala
diff options
context:
space:
mode:
authorVojin Jovanovic <gvojin@gmail.com>2015-09-29 16:19:29 +0200
committerVojin Jovanovic <gvojin@gmail.com>2015-09-29 16:19:29 +0200
commit88ed7637af4cfb40d68af58a385977c2a1703ece (patch)
treeed94906e1f873a529c2ca4e2490046a0c6c04124 /src/library-aux/scala/Any.scala
parent46c81c6be94152f8ecf3b9cfc27ca1bb393b46f1 (diff)
downloadscala-88ed7637af4cfb40d68af58a385977c2a1703ece.tar.gz
scala-88ed7637af4cfb40d68af58a385977c2a1703ece.tar.bz2
scala-88ed7637af4cfb40d68af58a385977c2a1703ece.zip
Fixing signatures of universal methods on `Any` and `AnyRef`.
Methods `getClass`, `isInstanceOf`, `asInstanceOf`, `notify`, `notifyAll`, and `wait` should be final. Method `getClass` should exist only on Any.
Diffstat (limited to 'src/library-aux/scala/Any.scala')
-rw-r--r--src/library-aux/scala/Any.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library-aux/scala/Any.scala b/src/library-aux/scala/Any.scala
index 8caf0c5c0e..635883096b 100644
--- a/src/library-aux/scala/Any.scala
+++ b/src/library-aux/scala/Any.scala
@@ -77,7 +77,7 @@ abstract class Any {
*
* @return a class object corresponding to the runtime type of the receiver.
*/
- def getClass(): Class[_]
+ final def getClass(): Class[_] = sys.error("getClass")
/** Test two objects for equality.
* The expression `x == that` is equivalent to `if (x eq null) that eq null else x.equals(that)`.
@@ -116,7 +116,7 @@ abstract class Any {
*
* @return `true` if the receiver object is an instance of erasure of type `T0`; `false` otherwise.
*/
- def isInstanceOf[T0]: Boolean = sys.error("isInstanceOf")
+ final def isInstanceOf[T0]: Boolean = sys.error("isInstanceOf")
/** Cast the receiver object to be of type `T0`.
*
@@ -129,5 +129,5 @@ abstract class Any {
* @throws ClassCastException if the receiver object is not an instance of the erasure of type `T0`.
* @return the receiver object.
*/
- def asInstanceOf[T0]: T0 = sys.error("asInstanceOf")
+ final def asInstanceOf[T0]: T0 = sys.error("asInstanceOf")
}