diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-08-22 13:58:17 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-08-22 14:00:11 +0200 |
commit | 0e5aa1c4ebe134be409736244d9c7fd69daced96 (patch) | |
tree | 779df194f4316bb8556e5320ff48c0cb6dbfa8a6 /src | |
parent | 376427590178989e1eefd2bf12123399169c3235 (diff) | |
download | scala-0e5aa1c4ebe134be409736244d9c7fd69daced96.tar.gz scala-0e5aa1c4ebe134be409736244d9c7fd69daced96.tar.bz2 scala-0e5aa1c4ebe134be409736244d9c7fd69daced96.zip |
reverts changes to ClassTag.Nothing
It seemed to be a good idea to have ClassTag.Nothing crash
in agreement with its incalculable nature.
However this breaks CanBuildFrom for the situations when Nothing is inferred
or provided explicitly. Hence the rollback.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/reflect/ClassTag.scala | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/library/scala/reflect/ClassTag.scala b/src/library/scala/reflect/ClassTag.scala index 7b6df6e31c..5255c44f10 100644 --- a/src/library/scala/reflect/ClassTag.scala +++ b/src/library/scala/reflect/ClassTag.scala @@ -64,6 +64,7 @@ trait ClassTag[T] extends ClassManifestDeprecatedApis[T] with Equals with Serial } object ClassTag { + private val NothingTYPE = classOf[scala.runtime.Nothing$] private val NullTYPE = classOf[scala.runtime.Null$] private val ObjectTYPE = classOf[java.lang.Object] @@ -80,13 +81,7 @@ object ClassTag { val Object : ClassTag[java.lang.Object] = new ClassTag[java.lang.Object]{ def runtimeClass = ObjectTYPE; private def readResolve() = ClassTag.Object } val AnyVal : ClassTag[scala.AnyVal] = ClassTag.Object.asInstanceOf[ClassTag[scala.AnyVal]] val AnyRef : ClassTag[scala.AnyRef] = ClassTag.Object.asInstanceOf[ClassTag[scala.AnyRef]] - val Nothing : ClassTag[scala.Nothing] = new ClassTag[scala.Nothing]{ - def runtimeClass = throw new Exception("Nothing is a bottom type, therefore its erasure does not return a value") - private def readResolve() = ClassTag.Nothing - override def equals(x: Any) = x.isInstanceOf[ClassTag[_]] && (x.asInstanceOf[AnyRef] eq ClassTag.Nothing) - override def hashCode = System.identityHashCode(this) - override def toString = "ClassTag[Nothing]" - } + val Nothing : ClassTag[scala.Nothing] = new ClassTag[scala.Nothing]{ def runtimeClass = NothingTYPE; private def readResolve() = ClassTag.Nothing } val Null : ClassTag[scala.Null] = new ClassTag[scala.Null]{ def runtimeClass = NullTYPE; private def readResolve() = ClassTag.Null } def apply[T](runtimeClass1: jClass[_]): ClassTag[T] = |