summaryrefslogtreecommitdiff
path: root/src/library/scala/Double.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-04-01 22:41:58 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2016-04-01 22:52:49 +0200
commitff442fc7bc7ab0b2fef82762c4705a15d8c17ecd (patch)
tree906c441643d3c8353e37d597228398f010b52aa7 /src/library/scala/Double.scala
parent19dac8212090f81ffd18bad6d7cc929fbff9bec8 (diff)
downloadscala-ff442fc7bc7ab0b2fef82762c4705a15d8c17ecd.tar.gz
scala-ff442fc7bc7ab0b2fef82762c4705a15d8c17ecd.tar.bz2
scala-ff442fc7bc7ab0b2fef82762c4705a15d8c17ecd.zip
SI-6710 Clarify stub methods in primitive value classes
- Replaces the implementations of box/unbox in AnyVal companions by `???`, the methods are only stubs, and the impls did not correspond to the actual behavior. The doc comment already points to the actual implementation in BoxesRunTime. - Replaces the body of `getClass` from `null` to `???` and clarifies in a comment why the overrides exist.
Diffstat (limited to 'src/library/scala/Double.scala')
-rw-r--r--src/library/scala/Double.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/library/scala/Double.scala b/src/library/scala/Double.scala
index a58fa3ed25..9b2cca2cbc 100644
--- a/src/library/scala/Double.scala
+++ b/src/library/scala/Double.scala
@@ -200,7 +200,8 @@ final abstract class Double private extends AnyVal {
/** Returns the remainder of the division of this value by `x`. */
def %(x: Double): Double
- override def getClass(): Class[Double] = null
+ // Provide a more specific return type for Scaladoc
+ override def getClass(): Class[Double] = ???
}
object Double extends AnyValCompanion {
@@ -229,7 +230,7 @@ object Double extends AnyValCompanion {
* @param x the Double to be boxed
* @return a java.lang.Double offering `x` as its underlying value.
*/
- def box(x: Double): java.lang.Double = java.lang.Double.valueOf(x)
+ def box(x: Double): java.lang.Double = ???
/** Transform a boxed type into a value type. Note that this
* method is not typesafe: it accepts any Object, but will throw
@@ -241,7 +242,7 @@ object Double extends AnyValCompanion {
* @throws ClassCastException if the argument is not a java.lang.Double
* @return the Double resulting from calling doubleValue() on `x`
*/
- def unbox(x: java.lang.Object): Double = x.asInstanceOf[java.lang.Double].doubleValue()
+ def unbox(x: java.lang.Object): Double = ???
/** The String representation of the scala.Double companion object. */
override def toString = "object scala.Double"