diff options
author | Paul Phillips <paulp@improving.org> | 2012-08-23 12:11:39 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-08-23 12:11:39 -0700 |
commit | bb939f2b03e3d99ff05fd792ec72c8a71a6df2f5 (patch) | |
tree | dfd89e2285e230ebd69784f7930b5439ddaddbd0 /src | |
parent | 1a1678dac0d4ff7d08efffbe2c80f324c173a69e (diff) | |
parent | 0e5aa1c4ebe134be409736244d9c7fd69daced96 (diff) | |
download | scala-bb939f2b03e3d99ff05fd792ec72c8a71a6df2f5.tar.gz scala-bb939f2b03e3d99ff05fd792ec72c8a71a6df2f5.tar.bz2 scala-bb939f2b03e3d99ff05fd792ec72c8a71a6df2f5.zip |
Merge pull request #1179 from scalamacros/topic/classtag-of-nothing
reverts changes to ClassTag.Nothing
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] = |