diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-09-26 08:13:03 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-09-27 15:49:02 +0200 |
commit | 95fd70ed1d2a3f4688c10a0e44509631d93d9afd (patch) | |
tree | 3ede14a006db932847647fe2dc5f8d427f076e3a | |
parent | ca9d2149e964604daf3a8d88d6946217ef90c643 (diff) | |
download | scala-95fd70ed1d2a3f4688c10a0e44509631d93d9afd.tar.gz scala-95fd70ed1d2a3f4688c10a0e44509631d93d9afd.tar.bz2 scala-95fd70ed1d2a3f4688c10a0e44509631d93d9afd.zip |
merges macros.Exprs and macros.TypeTags into Context
The former is a one-method trait, the latter is a two-method trait.
In a scaladoc these guys don't look like the pull their weight.
8 files changed, 6 insertions, 38 deletions
diff --git a/src/compiler/scala/reflect/macros/runtime/Aliases.scala b/src/compiler/scala/reflect/macros/runtime/Aliases.scala index 23489ed4ec..ff870e728e 100644 --- a/src/compiler/scala/reflect/macros/runtime/Aliases.scala +++ b/src/compiler/scala/reflect/macros/runtime/Aliases.scala @@ -16,11 +16,14 @@ trait Aliases { override type Expr[+T] = universe.Expr[T] override val Expr = universe.Expr + def Expr[T: WeakTypeTag](tree: Tree): Expr[T] = universe.Expr[T](mirror, universe.FixedMirrorTreeCreator(mirror, tree)) override type WeakTypeTag[T] = universe.WeakTypeTag[T] override type TypeTag[T] = universe.TypeTag[T] override val WeakTypeTag = universe.WeakTypeTag override val TypeTag = universe.TypeTag + def WeakTypeTag[T](tpe: Type): WeakTypeTag[T] = universe.WeakTypeTag[T](mirror, universe.FixedMirrorTypeCreator(mirror, tpe)) + def TypeTag[T](tpe: Type): TypeTag[T] = universe.TypeTag[T](mirror, universe.FixedMirrorTypeCreator(mirror, tpe)) override def weakTypeTag[T](implicit attag: WeakTypeTag[T]) = attag override def typeTag[T](implicit ttag: TypeTag[T]) = ttag override def weakTypeOf[T](implicit attag: WeakTypeTag[T]): Type = attag.tpe diff --git a/src/compiler/scala/reflect/macros/runtime/Context.scala b/src/compiler/scala/reflect/macros/runtime/Context.scala index cea3a9e5d8..1c6313c930 100644 --- a/src/compiler/scala/reflect/macros/runtime/Context.scala +++ b/src/compiler/scala/reflect/macros/runtime/Context.scala @@ -14,8 +14,6 @@ abstract class Context extends scala.reflect.macros.Context with Settings with Typers with Parsers - with Exprs - with TypeTags with Evals with ExprUtils with Traces { diff --git a/src/compiler/scala/reflect/macros/runtime/Exprs.scala b/src/compiler/scala/reflect/macros/runtime/Exprs.scala deleted file mode 100644 index ebf8fa2b96..0000000000 --- a/src/compiler/scala/reflect/macros/runtime/Exprs.scala +++ /dev/null @@ -1,8 +0,0 @@ -package scala.reflect.macros -package runtime - -trait Exprs { - self: Context => - - def Expr[T: WeakTypeTag](tree: Tree): Expr[T] = universe.Expr[T](mirror, universe.FixedMirrorTreeCreator(mirror, tree)) -} diff --git a/src/compiler/scala/reflect/macros/runtime/TypeTags.scala b/src/compiler/scala/reflect/macros/runtime/TypeTags.scala deleted file mode 100644 index 19b60159de..0000000000 --- a/src/compiler/scala/reflect/macros/runtime/TypeTags.scala +++ /dev/null @@ -1,9 +0,0 @@ -package scala.reflect.macros -package runtime - -trait TypeTags { - self: Context => - - def WeakTypeTag[T](tpe: Type): WeakTypeTag[T] = universe.WeakTypeTag[T](mirror, universe.FixedMirrorTypeCreator(mirror, tpe)) - def TypeTag[T](tpe: Type): TypeTag[T] = universe.TypeTag[T](mirror, universe.FixedMirrorTypeCreator(mirror, tpe)) -} diff --git a/src/reflect/scala/reflect/macros/Aliases.scala b/src/reflect/scala/reflect/macros/Aliases.scala index c026ab4d26..0073d57725 100644 --- a/src/reflect/scala/reflect/macros/Aliases.scala +++ b/src/reflect/scala/reflect/macros/Aliases.scala @@ -16,11 +16,14 @@ trait Aliases { type Expr[+T] = universe.Expr[T] val Expr = universe.Expr + def Expr[T: WeakTypeTag](tree: Tree): Expr[T] type WeakTypeTag[T] = universe.WeakTypeTag[T] type TypeTag[T] = universe.TypeTag[T] val WeakTypeTag = universe.WeakTypeTag val TypeTag = universe.TypeTag + def WeakTypeTag[T](tpe: Type): WeakTypeTag[T] + def TypeTag[T](tpe: Type): TypeTag[T] def weakTypeTag[T](implicit attag: WeakTypeTag[T]) = attag def typeTag[T](implicit ttag: TypeTag[T]) = ttag def weakTypeOf[T](implicit attag: WeakTypeTag[T]): Type = attag.tpe diff --git a/src/reflect/scala/reflect/macros/Context.scala b/src/reflect/scala/reflect/macros/Context.scala index 6142baf473..75f2e459b6 100644 --- a/src/reflect/scala/reflect/macros/Context.scala +++ b/src/reflect/scala/reflect/macros/Context.scala @@ -15,8 +15,6 @@ trait Context extends Aliases with Settings with Typers with Parsers - with Exprs - with TypeTags with Evals with ExprUtils { diff --git a/src/reflect/scala/reflect/macros/Exprs.scala b/src/reflect/scala/reflect/macros/Exprs.scala deleted file mode 100644 index 280d5508c8..0000000000 --- a/src/reflect/scala/reflect/macros/Exprs.scala +++ /dev/null @@ -1,8 +0,0 @@ -package scala.reflect -package macros - -trait Exprs { - self: Context => - - def Expr[T: WeakTypeTag](tree: Tree): Expr[T] -} diff --git a/src/reflect/scala/reflect/macros/TypeTags.scala b/src/reflect/scala/reflect/macros/TypeTags.scala deleted file mode 100644 index 2f15e37f6a..0000000000 --- a/src/reflect/scala/reflect/macros/TypeTags.scala +++ /dev/null @@ -1,9 +0,0 @@ -package scala.reflect -package macros - -trait TypeTags { - self: Context => - - def WeakTypeTag[T](tpe: Type): WeakTypeTag[T] - def TypeTag[T](tpe: Type): TypeTag[T] -} |