summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-09-15 20:44:22 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-09-16 16:44:28 +0200
commit4aad4eb6c1f10abd64ec5dfd8eeba091491349e2 (patch)
treefe3acaf1788a9a4e3c01888061a80094f973066b /src
parentdd9b286bc4c62dbe5dfde9d9e26a2c72404d436f (diff)
downloadscala-4aad4eb6c1f10abd64ec5dfd8eeba091491349e2.tar.gz
scala-4aad4eb6c1f10abd64ec5dfd8eeba091491349e2.tar.bz2
scala-4aad4eb6c1f10abd64ec5dfd8eeba091491349e2.zip
SI-7841 Remove AnyRef specialization from AbstractPartialFunction
This was missed in cc3badae1 Compatibility classes for formerly specialized variants used by Scalacheck have been added as a stopgap measure until we publish the next milestone.
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/runtime/AbstractPartialFunction.scala14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/library/scala/runtime/AbstractPartialFunction.scala b/src/library/scala/runtime/AbstractPartialFunction.scala
index e3516bc4d9..7129f22f60 100644
--- a/src/library/scala/runtime/AbstractPartialFunction.scala
+++ b/src/library/scala/runtime/AbstractPartialFunction.scala
@@ -25,7 +25,7 @@ import scala.annotation.unspecialized
* @author Pavel Pavlov
* @since 2.10
*/
-abstract class AbstractPartialFunction[@specialized(scala.Int, scala.Long, scala.Float, scala.Double, scala.AnyRef) -T1, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double, scala.AnyRef) +R] extends Function1[T1, R] with PartialFunction[T1, R] { self =>
+abstract class AbstractPartialFunction[@specialized(scala.Int, scala.Long, scala.Float, scala.Double) -T1, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends Function1[T1, R] with PartialFunction[T1, R] { self =>
// this method must be overridden for better performance,
// for backwards compatibility, fall back to the one inherited from PartialFunction
// this assumes the old-school partial functions override the apply method, though
@@ -35,3 +35,15 @@ abstract class AbstractPartialFunction[@specialized(scala.Int, scala.Long, scala
// let's not make it final so as not to confuse anyone
/*final*/ def apply(x: T1): R = applyOrElse(x, PartialFunction.empty)
}
+
+// Manual stand-ins for formerly specialized variations.
+// Not comprehensive, only sufficent to run scala-check built scala 2.11.0-M5
+// TODO Scala 2.10.0.M6 Remove this once scalacheck is published against M6.
+private[runtime] abstract class AbstractPartialFunction$mcIL$sp extends scala.runtime.AbstractPartialFunction[Any, Int] {
+ override def apply(x: Any): Int = apply$mcIL$sp(x)
+ def apply$mcIL$sp(x: Any): Int = applyOrElse(x, PartialFunction.empty)
+}
+private[runtime] abstract class AbstractPartialFunction$mcFL$sp extends scala.runtime.AbstractPartialFunction[Any, Float] {
+ override def apply(x: Any): Float = apply$mcIL$sp(x)
+ def apply$mcIL$sp(x: Any): Float = applyOrElse(x, PartialFunction.empty)
+}