summaryrefslogtreecommitdiff
path: root/src/partest
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-19 13:15:22 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-19 17:39:59 +0200
commiteadf1d2080e0ce763e4c1920a26b80c8b8609ca0 (patch)
treee172c5d2b9db0bf3786afa6ce5f40b13fd0eb1bd /src/partest
parent50b5bdefec899bf441742a40f525234eac65cbaa (diff)
downloadscala-eadf1d2080e0ce763e4c1920a26b80c8b8609ca0.tar.gz
scala-eadf1d2080e0ce763e4c1920a26b80c8b8609ca0.tar.bz2
scala-eadf1d2080e0ce763e4c1920a26b80c8b8609ca0.zip
prepping for the refactoring
Reification (both tree-based and type-based) should be avoided before we release 2.10.0-final, since it impairs reflection refactorings like the upcoming one. Also the upcoming refactoring moves tag materialization anchors, and we have to add them to fast track in advance, so that they are treated as macros later.
Diffstat (limited to 'src/partest')
-rw-r--r--src/partest/scala/tools/partest/package.scala35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/partest/scala/tools/partest/package.scala b/src/partest/scala/tools/partest/package.scala
index ebd3e46b7c..df1c296d47 100644
--- a/src/partest/scala/tools/partest/package.scala
+++ b/src/partest/scala/tools/partest/package.scala
@@ -93,11 +93,34 @@ package object partest {
import scala.reflect.macros.Context
def traceImpl[A: c.WeakTypeTag](c: Context)(a: c.Expr[A]): c.Expr[A] = {
import c.universe._
- val exprCode = c.literal(show(a.tree))
- val exprType = c.literal(show(a.actualType))
- reify {
- println(s"trace> ${exprCode.splice}\nres: ${exprType.splice} = ${a.splice}\n")
- a.splice
- }
+ import definitions._
+
+ // xeno.by: reify shouldn't be used explicitly before the final release of 2.10.0,
+ // because this impairs reflection refactorings
+ //
+ // val exprCode = c.literal(show(a.tree))
+ // val exprType = c.literal(show(a.actualType))
+ // reify {
+ // println(s"trace> ${exprCode.splice}\nres: ${exprType.splice} = ${a.splice}\n")
+ // a.splice
+ // }
+
+ c.Expr(Block(
+ List(Apply(
+ Select(Ident(PredefModule), newTermName("println")),
+ List(Apply(
+ Select(Apply(
+ Select(Ident(ScalaPackage), newTermName("StringContext")),
+ List(
+ Literal(Constant("trace> ")),
+ Literal(Constant("\\nres: ")),
+ Literal(Constant(" = ")),
+ Literal(Constant("\\n")))),
+ newTermName("s")),
+ List(
+ Literal(Constant(show(a.tree))),
+ Literal(Constant(show(a.actualType))),
+ a.tree))))),
+ a.tree))
}
}