diff options
author | Paul Phillips <paulp@improving.org> | 2013-01-06 14:43:31 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-01-06 14:43:31 -0800 |
commit | 766bb97114b5932b75340a9169558de61899997e (patch) | |
tree | dbb6375e3852a1a2819634bb4756c7b512b2e6df /src/library | |
parent | 649c27843d7e29b010c0132ce6b6f1342046fad2 (diff) | |
parent | 2ceec330743f430166235ed9b430eb7da1d27a30 (diff) | |
download | scala-766bb97114b5932b75340a9169558de61899997e.tar.gz scala-766bb97114b5932b75340a9169558de61899997e.tar.bz2 scala-766bb97114b5932b75340a9169558de61899997e.zip |
Merge pull request #1842 from adriaanm/backport-1821
Backport 1821
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/collection/mutable/WrappedArray.scala | 2 | ||||
-rw-r--r-- | src/library/scala/reflect/Manifest.scala | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/library/scala/collection/mutable/WrappedArray.scala b/src/library/scala/collection/mutable/WrappedArray.scala index f02f5a241f..b83724090c 100644 --- a/src/library/scala/collection/mutable/WrappedArray.scala +++ b/src/library/scala/collection/mutable/WrappedArray.scala @@ -62,7 +62,7 @@ extends AbstractSeq[T] override def par = ParArray.handoff(array) private def elementClass: Class[_] = - arrayElementClass(repr.getClass) + arrayElementClass(array.getClass) override def toArray[U >: T : ClassTag]: Array[U] = { val thatElementClass = arrayElementClass(implicitly[ClassTag[U]]) diff --git a/src/library/scala/reflect/Manifest.scala b/src/library/scala/reflect/Manifest.scala index eddfe63118..f62d0ecd16 100644 --- a/src/library/scala/reflect/Manifest.scala +++ b/src/library/scala/reflect/Manifest.scala @@ -162,11 +162,13 @@ object ManifestFactory { private val NullTYPE = classOf[scala.runtime.Null$] val Any: Manifest[scala.Any] = new PhantomManifest[scala.Any](ObjectTYPE, "Any") { + override def newArray(len: Int) = new Array[scala.Any](len) override def <:<(that: ClassManifest[_]): Boolean = (that eq this) private def readResolve(): Any = Manifest.Any } val Object: Manifest[java.lang.Object] = new PhantomManifest[java.lang.Object](ObjectTYPE, "Object") { + override def newArray(len: Int) = new Array[java.lang.Object](len) override def <:<(that: ClassManifest[_]): Boolean = (that eq this) || (that eq Any) private def readResolve(): Any = Manifest.Object } @@ -174,17 +176,20 @@ object ManifestFactory { val AnyRef: Manifest[scala.AnyRef] = Object.asInstanceOf[Manifest[scala.AnyRef]] val AnyVal: Manifest[scala.AnyVal] = new PhantomManifest[scala.AnyVal](ObjectTYPE, "AnyVal") { + override def newArray(len: Int) = new Array[scala.AnyVal](len) override def <:<(that: ClassManifest[_]): Boolean = (that eq this) || (that eq Any) private def readResolve(): Any = Manifest.AnyVal } val Null: Manifest[scala.Null] = new PhantomManifest[scala.Null](NullTYPE, "Null") { + override def newArray(len: Int) = new Array[scala.Null](len) override def <:<(that: ClassManifest[_]): Boolean = (that ne null) && (that ne Nothing) && !(that <:< AnyVal) private def readResolve(): Any = Manifest.Null } val Nothing: Manifest[scala.Nothing] = new PhantomManifest[scala.Nothing](NothingTYPE, "Nothing") { + override def newArray(len: Int) = new Array[scala.Nothing](len) override def <:<(that: ClassManifest[_]): Boolean = (that ne null) private def readResolve(): Any = Manifest.Nothing } |