summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2015-10-05 10:17:21 +0200
committerLukas Rytz <lukas.rytz@typesafe.com>2015-10-05 10:17:21 +0200
commit3bdef03d89e791760f3b484bec7a2226a52275ad (patch)
treec66fc048fdff18337e6a24bc4e95da6899d970b1
parent3d15ba085608ae2b39cf2e3f9bd899f07f942886 (diff)
parent88ed7637af4cfb40d68af58a385977c2a1703ece (diff)
downloadscala-3bdef03d89e791760f3b484bec7a2226a52275ad.tar.gz
scala-3bdef03d89e791760f3b484bec7a2226a52275ad.tar.bz2
scala-3bdef03d89e791760f3b484bec7a2226a52275ad.zip
Merge pull request #4772 from vjovanov/documentation/universal
Fixing signatures of universal methods on `Any` and `AnyRef`.
-rw-r--r--src/library-aux/scala/Any.scala6
-rw-r--r--src/library-aux/scala/AnyRef.scala19
2 files changed, 8 insertions, 17 deletions
diff --git a/src/library-aux/scala/Any.scala b/src/library-aux/scala/Any.scala
index e6ed46740e..68ec04e9c4 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")
}
diff --git a/src/library-aux/scala/AnyRef.scala b/src/library-aux/scala/AnyRef.scala
index 7217499da7..67090bae47 100644
--- a/src/library-aux/scala/AnyRef.scala
+++ b/src/library-aux/scala/AnyRef.scala
@@ -100,33 +100,24 @@ trait AnyRef extends Any {
*/
protected def finalize(): Unit
- /** A representation that corresponds to the dynamic class of the receiver object.
- *
- * The nature of the representation is platform dependent.
- *
- * @note not specified by SLS as a member of AnyRef
- * @return a representation that corresponds to the dynamic class of the receiver object.
- */
- def getClass(): Class[_]
-
/** Wakes up a single thread that is waiting on the receiver object's monitor.
*
* @note not specified by SLS as a member of AnyRef
*/
- def notify(): Unit
+ final def notify(): Unit
/** Wakes up all threads that are waiting on the receiver object's monitor.
*
* @note not specified by SLS as a member of AnyRef
*/
- def notifyAll(): Unit
+ final def notifyAll(): Unit
/** Causes the current Thread to wait until another Thread invokes
* the notify() or notifyAll() methods.
*
* @note not specified by SLS as a member of AnyRef
*/
- def wait (): Unit
- def wait (timeout: Long, nanos: Int): Unit
- def wait (timeout: Long): Unit
+ final def wait (): Unit
+ final def wait (timeout: Long, nanos: Int): Unit
+ final def wait (timeout: Long): Unit
}