From 4aad4eb6c1f10abd64ec5dfd8eeba091491349e2 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sun, 15 Sep 2013 20:44:22 +0200 Subject: 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. --- src/library/scala/runtime/AbstractPartialFunction.scala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') 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) +} -- cgit v1.2.3