Skip to content

Commit 95fd70e

Browse files
committed
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.
1 parent ca9d214 commit 95fd70e

File tree

8 files changed

+6
-38
lines changed

8 files changed

+6
-38
lines changed

src/compiler/scala/reflect/macros/runtime/Aliases.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ trait Aliases {
1616

1717
override type Expr[+T] = universe.Expr[T]
1818
override val Expr = universe.Expr
19+
def Expr[T: WeakTypeTag](tree: Tree): Expr[T] = universe.Expr[T](mirror, universe.FixedMirrorTreeCreator(mirror, tree))
1920

2021
override type WeakTypeTag[T] = universe.WeakTypeTag[T]
2122
override type TypeTag[T] = universe.TypeTag[T]
2223
override val WeakTypeTag = universe.WeakTypeTag
2324
override val TypeTag = universe.TypeTag
25+
def WeakTypeTag[T](tpe: Type): WeakTypeTag[T] = universe.WeakTypeTag[T](mirror, universe.FixedMirrorTypeCreator(mirror, tpe))
26+
def TypeTag[T](tpe: Type): TypeTag[T] = universe.TypeTag[T](mirror, universe.FixedMirrorTypeCreator(mirror, tpe))
2427
override def weakTypeTag[T](implicit attag: WeakTypeTag[T]) = attag
2528
override def typeTag[T](implicit ttag: TypeTag[T]) = ttag
2629
override def weakTypeOf[T](implicit attag: WeakTypeTag[T]): Type = attag.tpe

src/compiler/scala/reflect/macros/runtime/Context.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ abstract class Context extends scala.reflect.macros.Context
1414
with Settings
1515
with Typers
1616
with Parsers
17-
with Exprs
18-
with TypeTags
1917
with Evals
2018
with ExprUtils
2119
with Traces {

src/compiler/scala/reflect/macros/runtime/Exprs.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/compiler/scala/reflect/macros/runtime/TypeTags.scala

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/reflect/scala/reflect/macros/Aliases.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ trait Aliases {
1616

1717
type Expr[+T] = universe.Expr[T]
1818
val Expr = universe.Expr
19+
def Expr[T: WeakTypeTag](tree: Tree): Expr[T]
1920

2021
type WeakTypeTag[T] = universe.WeakTypeTag[T]
2122
type TypeTag[T] = universe.TypeTag[T]
2223
val WeakTypeTag = universe.WeakTypeTag
2324
val TypeTag = universe.TypeTag
25+
def WeakTypeTag[T](tpe: Type): WeakTypeTag[T]
26+
def TypeTag[T](tpe: Type): TypeTag[T]
2427
def weakTypeTag[T](implicit attag: WeakTypeTag[T]) = attag
2528
def typeTag[T](implicit ttag: TypeTag[T]) = ttag
2629
def weakTypeOf[T](implicit attag: WeakTypeTag[T]): Type = attag.tpe

src/reflect/scala/reflect/macros/Context.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ trait Context extends Aliases
1515
with Settings
1616
with Typers
1717
with Parsers
18-
with Exprs
19-
with TypeTags
2018
with Evals
2119
with ExprUtils {
2220

src/reflect/scala/reflect/macros/Exprs.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/reflect/scala/reflect/macros/TypeTags.scala

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)