summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-07-02 13:21:20 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-07-02 13:21:20 +0200
commit3becbd55aff0401f31fa6782c69c81b88befe39d (patch)
tree5af1b9f7b0b91ed513d39ab03307d513a5e01301
parent3237b1cd6fc2b2029080fe9d4b2b76d43ab8011c (diff)
downloadscala-3becbd55aff0401f31fa6782c69c81b88befe39d.tar.gz
scala-3becbd55aff0401f31fa6782c69c81b88befe39d.tar.bz2
scala-3becbd55aff0401f31fa6782c69c81b88befe39d.zip
removes ClassTag.String and TypeTag.String
TypeTag.String is removed because it's unclear whether it should point to scala.Predef.String or to java.lang.String. ClassTag.String is removed to be consistent with TypeTag.String. This requires re-bootstrapping, because Definitions.scala in locker expects classTag[String] being automatically generated, whereas starr disagrees with locker on how to generate that class tag.
-rw-r--r--lib/scala-compiler.jar.desired.sha12
-rw-r--r--lib/scala-library.jar.desired.sha12
-rw-r--r--lib/scala-reflect.jar.desired.sha12
-rw-r--r--src/compiler/scala/reflect/makro/runtime/ExprUtils.scala2
-rw-r--r--src/compiler/scala/reflect/reify/Taggers.scala27
-rw-r--r--src/compiler/scala/tools/reflect/StdTags.scala9
-rw-r--r--src/library/scala/reflect/ClassTag.scala3
-rw-r--r--src/library/scala/reflect/base/Base.scala1
-rw-r--r--src/library/scala/reflect/base/StandardDefinitions.scala1
-rw-r--r--src/library/scala/reflect/base/TypeTags.scala4
-rw-r--r--src/reflect/scala/reflect/internal/Definitions.scala1
-rw-r--r--test/files/run/abstypetags_core.check2
-rw-r--r--test/files/run/abstypetags_core.scala2
-rw-r--r--test/files/run/classtags_core.check2
-rw-r--r--test/files/run/classtags_core.scala2
-rw-r--r--test/files/run/typetags_core.check (renamed from test/files/run/concretetypetags_core.check)54
-rw-r--r--test/files/run/typetags_core.scala (renamed from test/files/run/concretetypetags_core.scala)2
-rw-r--r--test/files/run/typetags_multi.check (renamed from test/files/run/concretetypetags_multi.check)0
-rw-r--r--test/files/run/typetags_multi.scala (renamed from test/files/run/concretetypetags_multi.scala)0
19 files changed, 51 insertions, 67 deletions
diff --git a/lib/scala-compiler.jar.desired.sha1 b/lib/scala-compiler.jar.desired.sha1
index ec83f4290f..9a47d9f730 100644
--- a/lib/scala-compiler.jar.desired.sha1
+++ b/lib/scala-compiler.jar.desired.sha1
@@ -1 +1 @@
-7698de137191bd7d8cbee61e841efb9a3bb1e343 ?scala-compiler.jar
+554bcc4a543360c8dc48fde91124dc57319d3460 ?scala-compiler.jar
diff --git a/lib/scala-library.jar.desired.sha1 b/lib/scala-library.jar.desired.sha1
index 86bbbcf981..ec73b5f7b8 100644
--- a/lib/scala-library.jar.desired.sha1
+++ b/lib/scala-library.jar.desired.sha1
@@ -1 +1 @@
-823dd2a1914ff3e0c9be3b9c4cc44d6e7edf416c ?scala-library.jar
+071d32b24daaeaf961675f248758fedd31a806ed ?scala-library.jar
diff --git a/lib/scala-reflect.jar.desired.sha1 b/lib/scala-reflect.jar.desired.sha1
index 86aed8102f..4be2e84aef 100644
--- a/lib/scala-reflect.jar.desired.sha1
+++ b/lib/scala-reflect.jar.desired.sha1
@@ -1 +1 @@
-741636e9f419fcc302b249176ddc1420784b32fd ?scala-reflect.jar
+b6e2bbbc1707104119adcb09aeb666690419c424 ?scala-reflect.jar
diff --git a/src/compiler/scala/reflect/makro/runtime/ExprUtils.scala b/src/compiler/scala/reflect/makro/runtime/ExprUtils.scala
index 4775138e5a..e301dfc2a4 100644
--- a/src/compiler/scala/reflect/makro/runtime/ExprUtils.scala
+++ b/src/compiler/scala/reflect/makro/runtime/ExprUtils.scala
@@ -29,7 +29,7 @@ trait ExprUtils {
def literal(x: Double) = Expr[Double](Literal(Constant(x)))(TypeTag.Double)
- def literal(x: String) = Expr[String](Literal(Constant(x)))(TypeTag.String)
+ def literal(x: String) = Expr[String](Literal(Constant(x)))(TypeTag[String](definitions.StringClass.asTypeConstructor))
def literal(x: Char) = Expr[Char](Literal(Constant(x)))(TypeTag.Char)
}
diff --git a/src/compiler/scala/reflect/reify/Taggers.scala b/src/compiler/scala/reflect/reify/Taggers.scala
index b70c3f44a3..e4c3d02f22 100644
--- a/src/compiler/scala/reflect/reify/Taggers.scala
+++ b/src/compiler/scala/reflect/reify/Taggers.scala
@@ -11,20 +11,19 @@ abstract class Taggers {
import treeBuild._
val coreTags = Map(
- ByteClass.asType -> nme.Byte,
- ShortClass.asType -> nme.Short,
- CharClass.asType -> nme.Char,
- IntClass.asType -> nme.Int,
- LongClass.asType -> nme.Long,
- FloatClass.asType -> nme.Float,
- DoubleClass.asType -> nme.Double,
- BooleanClass.asType -> nme.Boolean,
- UnitClass.asType -> nme.Unit,
- AnyClass.asType -> nme.Any,
- ObjectClass.asType -> nme.Object,
- NothingClass.asType -> nme.Nothing,
- NullClass.asType -> nme.Null,
- StringClass.asType -> nme.String)
+ ByteTpe -> nme.Byte,
+ ShortTpe -> nme.Short,
+ CharTpe -> nme.Char,
+ IntTpe -> nme.Int,
+ LongTpe -> nme.Long,
+ FloatTpe -> nme.Float,
+ DoubleTpe -> nme.Double,
+ BooleanTpe -> nme.Boolean,
+ UnitTpe -> nme.Unit,
+ AnyTpe -> nme.Any,
+ ObjectTpe -> nme.Object,
+ NothingTpe -> nme.Nothing,
+ NullTpe -> nme.Null)
def materializeClassTag(prefix: Tree, tpe: Type): Tree = {
val tagModule = ClassTagModule
diff --git a/src/compiler/scala/tools/reflect/StdTags.scala b/src/compiler/scala/tools/reflect/StdTags.scala
index c782181f21..18cbf9c4b7 100644
--- a/src/compiler/scala/tools/reflect/StdTags.scala
+++ b/src/compiler/scala/tools/reflect/StdTags.scala
@@ -12,7 +12,14 @@ import scala.reflect.runtime.{universe => ru}
object StdTags {
// root mirror is fine for these guys, since scala-library.jar is guaranteed to be reachable from the root mirror
- lazy val tagOfString = ru.TypeTag.String
+ lazy val tagOfString = ru.TypeTag[String](
+ ru.rootMirror,
+ new TypeCreator {
+ def apply[U <: BaseUniverse with Singleton](m: MirrorOf[U]): U # Type = {
+ val u = m.universe
+ u.definitions.StringClass.asTypeConstructor
+ }
+ })
lazy val tagOfListOfString = ru.TypeTag[List[String]](
ru.rootMirror,
new TypeCreator {
diff --git a/src/library/scala/reflect/ClassTag.scala b/src/library/scala/reflect/ClassTag.scala
index eb63defeb3..8d7b0858ef 100644
--- a/src/library/scala/reflect/ClassTag.scala
+++ b/src/library/scala/reflect/ClassTag.scala
@@ -67,7 +67,6 @@ object ClassTag {
private val NothingTYPE = classOf[scala.runtime.Nothing$]
private val NullTYPE = classOf[scala.runtime.Null$]
private val ObjectTYPE = classOf[java.lang.Object]
- private val StringTYPE = classOf[java.lang.String]
val Byte : ClassTag[scala.Byte] = new ClassTag[scala.Byte]{ def runtimeClass = java.lang.Byte.TYPE; private def readResolve() = ClassTag.Byte }
val Short : ClassTag[scala.Short] = new ClassTag[scala.Short]{ def runtimeClass = java.lang.Short.TYPE; private def readResolve() = ClassTag.Short }
@@ -84,7 +83,6 @@ object ClassTag {
val AnyRef : ClassTag[scala.AnyRef] = new ClassTag[scala.AnyRef]{ def runtimeClass = ObjectTYPE; private def readResolve() = ClassTag.AnyRef }
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 }
- val String : ClassTag[java.lang.String] = new ClassTag[java.lang.String]{ def runtimeClass = StringTYPE; private def readResolve() = ClassTag.String }
def apply[T](runtimeClass1: jClass[_]): ClassTag[T] =
runtimeClass1 match {
@@ -98,7 +96,6 @@ object ClassTag {
case java.lang.Boolean.TYPE => ClassTag.Boolean.asInstanceOf[ClassTag[T]]
case java.lang.Void.TYPE => ClassTag.Unit.asInstanceOf[ClassTag[T]]
case ObjectTYPE => ClassTag.Object.asInstanceOf[ClassTag[T]]
- case StringTYPE => ClassTag.String.asInstanceOf[ClassTag[T]]
case _ => new ClassTag[T]{ def runtimeClass = runtimeClass1 }
}
diff --git a/src/library/scala/reflect/base/Base.scala b/src/library/scala/reflect/base/Base.scala
index 490a9e8c03..0a761767f2 100644
--- a/src/library/scala/reflect/base/Base.scala
+++ b/src/library/scala/reflect/base/Base.scala
@@ -420,7 +420,6 @@ class Base extends Universe { self =>
lazy val NullTpe = TypeRef(ScalaPrefix, NullClass, Nil)
lazy val ObjectTpe = TypeRef(JavaLangPrefix, ObjectClass, Nil)
lazy val AnyRefTpe = ObjectTpe
- lazy val StringTpe = TypeRef(JavaLangPrefix, StringClass, Nil)
private var nodeCount = 0 // not synchronized
diff --git a/src/library/scala/reflect/base/StandardDefinitions.scala b/src/library/scala/reflect/base/StandardDefinitions.scala
index eff23b539e..2f270a5911 100644
--- a/src/library/scala/reflect/base/StandardDefinitions.scala
+++ b/src/library/scala/reflect/base/StandardDefinitions.scala
@@ -27,7 +27,6 @@ trait StandardTypes {
val NothingTpe: Type
val NullTpe: Type
- val StringTpe: Type
}
trait StandardDefinitions extends StandardTypes {
diff --git a/src/library/scala/reflect/base/TypeTags.scala b/src/library/scala/reflect/base/TypeTags.scala
index 774bc6ebea..1906118ed1 100644
--- a/src/library/scala/reflect/base/TypeTags.scala
+++ b/src/library/scala/reflect/base/TypeTags.scala
@@ -137,7 +137,6 @@ trait TypeTags { self: Universe =>
val Object : AbsTypeTag[java.lang.Object] = TypeTag.Object
val Nothing : AbsTypeTag[scala.Nothing] = TypeTag.Nothing
val Null : AbsTypeTag[scala.Null] = TypeTag.Null
- val String : AbsTypeTag[java.lang.String] = TypeTag.String
def apply[T](mirror1: MirrorOf[self.type], tpec1: TypeCreator): AbsTypeTag[T] =
tpec1(mirror1) match {
@@ -154,7 +153,6 @@ trait TypeTags { self: Universe =>
case ObjectTpe => AbsTypeTag.Object.asInstanceOf[AbsTypeTag[T]]
case NothingTpe => AbsTypeTag.Nothing.asInstanceOf[AbsTypeTag[T]]
case NullTpe => AbsTypeTag.Null.asInstanceOf[AbsTypeTag[T]]
- case StringTpe => AbsTypeTag.String.asInstanceOf[AbsTypeTag[T]]
case _ => new AbsTypeTagImpl[T](mirror1.asInstanceOf[Mirror], tpec1)
}
@@ -200,7 +198,6 @@ trait TypeTags { self: Universe =>
val Object: TypeTag[java.lang.Object] = new PredefTypeTag[java.lang.Object] (ObjectTpe, _.TypeTag.Object)
val Nothing: TypeTag[scala.Nothing] = new PredefTypeTag[scala.Nothing] (NothingTpe, _.TypeTag.Nothing)
val Null: TypeTag[scala.Null] = new PredefTypeTag[scala.Null] (NullTpe, _.TypeTag.Null)
- val String: TypeTag[java.lang.String] = new PredefTypeTag[java.lang.String] (StringTpe, _.TypeTag.String)
def apply[T](mirror1: MirrorOf[self.type], tpec1: TypeCreator): TypeTag[T] =
tpec1(mirror1) match {
@@ -217,7 +214,6 @@ trait TypeTags { self: Universe =>
case ObjectTpe => TypeTag.Object.asInstanceOf[TypeTag[T]]
case NothingTpe => TypeTag.Nothing.asInstanceOf[TypeTag[T]]
case NullTpe => TypeTag.Null.asInstanceOf[TypeTag[T]]
- case StringTpe => TypeTag.String.asInstanceOf[TypeTag[T]]
case _ => new TypeTagImpl[T](mirror1.asInstanceOf[Mirror], tpec1)
}
diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala
index fc708a5ecd..7891433b4f 100644
--- a/src/reflect/scala/reflect/internal/Definitions.scala
+++ b/src/reflect/scala/reflect/internal/Definitions.scala
@@ -35,7 +35,6 @@ trait Definitions extends api.StandardDefinitions {
lazy val AnyRefTpe = definitions.AnyRefClass.asType
lazy val NothingTpe = definitions.NothingClass.asType
lazy val NullTpe = definitions.NullClass.asType
- lazy val StringTpe = definitions.StringClass.asType
/** Since both the value parameter types and the result type may
* require access to the type parameter symbols, we model polymorphic
diff --git a/test/files/run/abstypetags_core.check b/test/files/run/abstypetags_core.check
index 55c8cb7e89..ec93221a30 100644
--- a/test/files/run/abstypetags_core.check
+++ b/test/files/run/abstypetags_core.check
@@ -24,5 +24,3 @@ true
TypeTag[Null]
true
TypeTag[Nothing]
-true
-TypeTag[java.lang.String]
diff --git a/test/files/run/abstypetags_core.scala b/test/files/run/abstypetags_core.scala
index a49817f4d4..dbe9b5e11d 100644
--- a/test/files/run/abstypetags_core.scala
+++ b/test/files/run/abstypetags_core.scala
@@ -27,6 +27,4 @@ object Test extends App {
println(implicitly[AbsTypeTag[Null]])
println(implicitly[AbsTypeTag[Nothing]] eq AbsTypeTag.Nothing)
println(implicitly[AbsTypeTag[Nothing]])
- println(implicitly[AbsTypeTag[String]] eq AbsTypeTag.String)
- println(implicitly[AbsTypeTag[String]])
} \ No newline at end of file
diff --git a/test/files/run/classtags_core.check b/test/files/run/classtags_core.check
index 7beada3f1c..ce7793e188 100644
--- a/test/files/run/classtags_core.check
+++ b/test/files/run/classtags_core.check
@@ -24,5 +24,3 @@ true
ClassTag[class scala.runtime.Null$]
true
ClassTag[class scala.runtime.Nothing$]
-true
-ClassTag[class java.lang.String]
diff --git a/test/files/run/classtags_core.scala b/test/files/run/classtags_core.scala
index 17c69d9c41..ad5e12a8c2 100644
--- a/test/files/run/classtags_core.scala
+++ b/test/files/run/classtags_core.scala
@@ -27,6 +27,4 @@ object Test extends App {
println(implicitly[ClassTag[Null]])
println(implicitly[ClassTag[Nothing]] eq ClassTag.Nothing)
println(implicitly[ClassTag[Nothing]])
- println(implicitly[ClassTag[String]] eq ClassTag.String)
- println(implicitly[ClassTag[String]])
} \ No newline at end of file
diff --git a/test/files/run/concretetypetags_core.check b/test/files/run/typetags_core.check
index d042e0900d..ec93221a30 100644
--- a/test/files/run/concretetypetags_core.check
+++ b/test/files/run/typetags_core.check
@@ -1,28 +1,26 @@
-true
-TypeTag[Byte]
-true
-TypeTag[Short]
-true
-TypeTag[Char]
-true
-TypeTag[Int]
-true
-TypeTag[Long]
-true
-TypeTag[Float]
-true
-TypeTag[Double]
-true
-TypeTag[Boolean]
-true
-TypeTag[Unit]
-true
-TypeTag[Any]
-true
-TypeTag[java.lang.Object]
-true
-TypeTag[Null]
-true
-TypeTag[Nothing]
-true
-TypeTag[java.lang.String]
+true
+TypeTag[Byte]
+true
+TypeTag[Short]
+true
+TypeTag[Char]
+true
+TypeTag[Int]
+true
+TypeTag[Long]
+true
+TypeTag[Float]
+true
+TypeTag[Double]
+true
+TypeTag[Boolean]
+true
+TypeTag[Unit]
+true
+TypeTag[Any]
+true
+TypeTag[java.lang.Object]
+true
+TypeTag[Null]
+true
+TypeTag[Nothing]
diff --git a/test/files/run/concretetypetags_core.scala b/test/files/run/typetags_core.scala
index a870f77c5f..0d86fac25b 100644
--- a/test/files/run/concretetypetags_core.scala
+++ b/test/files/run/typetags_core.scala
@@ -27,6 +27,4 @@ object Test extends App {
println(implicitly[TypeTag[Null]])
println(implicitly[TypeTag[Nothing]] eq TypeTag.Nothing)
println(implicitly[TypeTag[Nothing]])
- println(implicitly[TypeTag[String]] eq TypeTag.String)
- println(implicitly[TypeTag[String]])
} \ No newline at end of file
diff --git a/test/files/run/concretetypetags_multi.check b/test/files/run/typetags_multi.check
index 6110252c36..6110252c36 100644
--- a/test/files/run/concretetypetags_multi.check
+++ b/test/files/run/typetags_multi.check
diff --git a/test/files/run/concretetypetags_multi.scala b/test/files/run/typetags_multi.scala
index b30aac80a6..b30aac80a6 100644
--- a/test/files/run/concretetypetags_multi.scala
+++ b/test/files/run/typetags_multi.scala