summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-02-17 23:18:50 +0100
committerEugene Burmako <xeno.by@gmail.com>2014-02-18 09:23:38 +0100
commitafecfe90cd98a657ce83f3e833c940518563064e (patch)
tree23f0dd8d4a1a9aebf47f098c65c83746da4f0efc /src/reflect
parent34532d7e92b8ed2a9411260007fcfcc00f377ccc (diff)
downloadscala-afecfe90cd98a657ce83f3e833c940518563064e.tar.gz
scala-afecfe90cd98a657ce83f3e833c940518563064e.tar.bz2
scala-afecfe90cd98a657ce83f3e833c940518563064e.zip
reverses SI-6484
Unfortunately I have to revert b017629 because of SI-8303. There are projects (e.g. slick) that use typeOf in annotations, which effectively means bye-bye.
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/api/TypeTags.scala16
-rw-r--r--src/reflect/scala/reflect/internal/StdNames.scala2
-rw-r--r--src/reflect/scala/reflect/macros/Aliases.scala12
3 files changed, 3 insertions, 27 deletions
diff --git a/src/reflect/scala/reflect/api/TypeTags.scala b/src/reflect/scala/reflect/api/TypeTags.scala
index 1d5bf5d28b..1dfc84be69 100644
--- a/src/reflect/scala/reflect/api/TypeTags.scala
+++ b/src/reflect/scala/reflect/api/TypeTags.scala
@@ -326,25 +326,13 @@ trait TypeTags { self: Universe =>
* Shortcut for `implicitly[WeakTypeTag[T]].tpe`
* @group TypeTags
*/
- def weakTypeOf[T](implicit attag: WeakTypeTag[T]): Type = if (attag != null) attag.tpe else typeOf[Null]
-
- /**
- * Type of `x` as derived from a weak type tag.
- * @group TypeTags
- */
- def weakTypeOf[T: WeakTypeTag](x: => T): Type = weakTypeOf[T]
+ def weakTypeOf[T](implicit attag: WeakTypeTag[T]): Type = attag.tpe
/**
* Shortcut for `implicitly[TypeTag[T]].tpe`
* @group TypeTags
*/
- def typeOf[T](implicit ttag: TypeTag[T]): Type = if (ttag != null) ttag.tpe else typeOf[Null]
-
- /**
- * Type of `x` as derived from a type tag.
- * @group TypeTags
- */
- def typeOf[T: TypeTag](x: => T): Type = typeOf[T]
+ def typeOf[T](implicit ttag: TypeTag[T]): Type = ttag.tpe
/**
* Type symbol of `x` as derived from a type tag.
diff --git a/src/reflect/scala/reflect/internal/StdNames.scala b/src/reflect/scala/reflect/internal/StdNames.scala
index b95c83d6cb..0c28c4fba4 100644
--- a/src/reflect/scala/reflect/internal/StdNames.scala
+++ b/src/reflect/scala/reflect/internal/StdNames.scala
@@ -787,7 +787,6 @@ trait StdNames {
val tree : NameType = "tree"
val true_ : NameType = "true"
val typedProductIterator: NameType = "typedProductIterator"
- val typeOf: NameType = "typeOf"
val TypeName: NameType = "TypeName"
val typeTagToManifest: NameType = "typeTagToManifest"
val unapply: NameType = "unapply"
@@ -802,7 +801,6 @@ trait StdNames {
val valueOf : NameType = "valueOf"
val values : NameType = "values"
val wait_ : NameType = "wait"
- val weakTypeOf: NameType = "weakTypeOf"
val withFilter: NameType = "withFilter"
val zero: NameType = "zero"
diff --git a/src/reflect/scala/reflect/macros/Aliases.scala b/src/reflect/scala/reflect/macros/Aliases.scala
index bd918bbe56..64819a8601 100644
--- a/src/reflect/scala/reflect/macros/Aliases.scala
+++ b/src/reflect/scala/reflect/macros/Aliases.scala
@@ -110,12 +110,7 @@ trait Aliases {
/**
* Shortcut for `implicitly[WeakTypeTag[T]].tpe`
*/
- def weakTypeOf[T](implicit attag: WeakTypeTag[T]): Type = if (attag != null) attag.tpe else typeOf[Null]
-
- /**
- * Type of `x` as derived from a weak type tag.
- */
- def weakTypeOf[T: WeakTypeTag](x: => T): Type = weakTypeOf[T]
+ def weakTypeOf[T](implicit attag: WeakTypeTag[T]): Type = attag.tpe
/**
* Shortcut for `implicitly[TypeTag[T]].tpe`
@@ -123,11 +118,6 @@ trait Aliases {
def typeOf[T](implicit ttag: TypeTag[T]): Type = ttag.tpe
/**
- * Type of `x` as derived from a type tag.
- */
- def typeOf[T: TypeTag](x: => T): Type = typeOf[T]
-
- /**
* Type symbol of `x` as derived from a type tag.
*/
def symbolOf[T: WeakTypeTag]: universe.TypeSymbol = universe.symbolOf[T]