summaryrefslogtreecommitdiff
path: root/test/instrumented
diff options
context:
space:
mode:
Diffstat (limited to 'test/instrumented')
-rw-r--r--test/instrumented/library/scala/runtime/ScalaRunTime.scala3
-rw-r--r--test/instrumented/srt.patch69
2 files changed, 56 insertions, 16 deletions
diff --git a/test/instrumented/library/scala/runtime/ScalaRunTime.scala b/test/instrumented/library/scala/runtime/ScalaRunTime.scala
index f0d452a9be..5a3f83015f 100644
--- a/test/instrumented/library/scala/runtime/ScalaRunTime.scala
+++ b/test/instrumented/library/scala/runtime/ScalaRunTime.scala
@@ -14,7 +14,7 @@ import scala.collection.{ Seq, IndexedSeq, TraversableView, AbstractIterator }
import scala.collection.mutable.WrappedArray
import scala.collection.immutable.{ StringLike, NumericRange, List, Stream, Nil, :: }
import scala.collection.generic.{ Sorted }
-import scala.reflect.{ ArrayTag, ClassTag, arrayTag, classTag }
+import scala.reflect.{ ClassTag, classTag }
import scala.util.control.ControlThrowable
import scala.xml.{ Node, MetaData }
@@ -63,7 +63,6 @@ object ScalaRunTime {
def arrayElementClass(schematic: Any): Class[_] = schematic match {
case cls: Class[_] => cls.getComponentType
case tag: ClassTag[_] => tag.runtimeClass
- case tag: ArrayTag[_] => tag.newArray(0).getClass.getComponentType
case _ => throw new UnsupportedOperationException("unsupported schematic %s (%s)".format(schematic, if (schematic == null) "null" else schematic.getClass))
}
diff --git a/test/instrumented/srt.patch b/test/instrumented/srt.patch
index 366763e7f9..47dcfa2197 100644
--- a/test/instrumented/srt.patch
+++ b/test/instrumented/srt.patch
@@ -1,26 +1,67 @@
-9a10,11
+8a9,10
> /* INSTRUMENTED VERSION */
->
-44c46,49
-< def isTuple(x: Any) = x != null && tupleNames(x.getClass.getName)
----
+>
+73a76,77
> var arrayApplyCount = 0
-> var arrayUpdateCount = 0
->
-> def isTuple(x: Any) = tupleNames(x.getClass.getName)
-76c81,83
+>
+75,86c79,93
< def array_apply(xs: AnyRef, idx: Int): Any = xs match {
+< case x: Array[AnyRef] => x(idx).asInstanceOf[Any]
+< case x: Array[Int] => x(idx).asInstanceOf[Any]
+< case x: Array[Double] => x(idx).asInstanceOf[Any]
+< case x: Array[Long] => x(idx).asInstanceOf[Any]
+< case x: Array[Float] => x(idx).asInstanceOf[Any]
+< case x: Array[Char] => x(idx).asInstanceOf[Any]
+< case x: Array[Byte] => x(idx).asInstanceOf[Any]
+< case x: Array[Short] => x(idx).asInstanceOf[Any]
+< case x: Array[Boolean] => x(idx).asInstanceOf[Any]
+< case x: Array[Unit] => x(idx).asInstanceOf[Any]
+< case null => throw new NullPointerException
---
> def array_apply(xs: AnyRef, idx: Int): Any = {
> arrayApplyCount += 1
> xs match {
-88a96
-> }
-91c99,101
+> case x: Array[AnyRef] => x(idx).asInstanceOf[Any]
+> case x: Array[Int] => x(idx).asInstanceOf[Any]
+> case x: Array[Double] => x(idx).asInstanceOf[Any]
+> case x: Array[Long] => x(idx).asInstanceOf[Any]
+> case x: Array[Float] => x(idx).asInstanceOf[Any]
+> case x: Array[Char] => x(idx).asInstanceOf[Any]
+> case x: Array[Byte] => x(idx).asInstanceOf[Any]
+> case x: Array[Short] => x(idx).asInstanceOf[Any]
+> case x: Array[Boolean] => x(idx).asInstanceOf[Any]
+> case x: Array[Unit] => x(idx).asInstanceOf[Any]
+> case null => throw new NullPointerException
+> }
+88a96,97
+> var arrayUpdateCount = 0
+>
+90,101c99,113
< def array_update(xs: AnyRef, idx: Int, value: Any): Unit = xs match {
+< case x: Array[AnyRef] => x(idx) = value.asInstanceOf[AnyRef]
+< case x: Array[Int] => x(idx) = value.asInstanceOf[Int]
+< case x: Array[Double] => x(idx) = value.asInstanceOf[Double]
+< case x: Array[Long] => x(idx) = value.asInstanceOf[Long]
+< case x: Array[Float] => x(idx) = value.asInstanceOf[Float]
+< case x: Array[Char] => x(idx) = value.asInstanceOf[Char]
+< case x: Array[Byte] => x(idx) = value.asInstanceOf[Byte]
+< case x: Array[Short] => x(idx) = value.asInstanceOf[Short]
+< case x: Array[Boolean] => x(idx) = value.asInstanceOf[Boolean]
+< case x: Array[Unit] => x(idx) = value.asInstanceOf[Unit]
+< case null => throw new NullPointerException
---
> def array_update(xs: AnyRef, idx: Int, value: Any): Unit = {
> arrayUpdateCount += 1
> xs match {
-102a113
-> }
+> case x: Array[AnyRef] => x(idx) = value.asInstanceOf[AnyRef]
+> case x: Array[Int] => x(idx) = value.asInstanceOf[Int]
+> case x: Array[Double] => x(idx) = value.asInstanceOf[Double]
+> case x: Array[Long] => x(idx) = value.asInstanceOf[Long]
+> case x: Array[Float] => x(idx) = value.asInstanceOf[Float]
+> case x: Array[Char] => x(idx) = value.asInstanceOf[Char]
+> case x: Array[Byte] => x(idx) = value.asInstanceOf[Byte]
+> case x: Array[Short] => x(idx) = value.asInstanceOf[Short]
+> case x: Array[Boolean] => x(idx) = value.asInstanceOf[Boolean]
+> case x: Array[Unit] => x(idx) = value.asInstanceOf[Unit]
+> case null => throw new NullPointerException
+> }