summaryrefslogtreecommitdiff
path: root/src/partest
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-09-20 14:33:59 -0700
committerPaul Phillips <paulp@improving.org>2012-09-20 15:07:28 -0700
commit2097a653642927c39b1cb614546240ac9213f3fb (patch)
tree646778309893b3394fc36c720bd0bda4e0f86006 /src/partest
parentfeb77881ff8bc1e46c8ae4317a9d95cbf97e34bd (diff)
parentc065bde5f50cae3e1fa6d0724e2043818d6301e9 (diff)
downloadscala-2097a653642927c39b1cb614546240ac9213f3fb.tar.gz
scala-2097a653642927c39b1cb614546240ac9213f3fb.tar.bz2
scala-2097a653642927c39b1cb614546240ac9213f3fb.zip
Merge branch '2.10.x'
* 2.10.x: (36 commits) Normalized line endings. New .gitattributes file. Disabled failing build manager tests. New test case for SI-6337 New test case for closing SI-6385 Value classes: eliminated half-boxing Cleanup of OverridingPairs Fixes SI-6260 Use faster download URL now that artifactory is fixed. don't try to create tags w/o scala-reflect.jar some small remaining fixes SI-5943 toolboxes now autoimport Predef and scala Fix for loud test. SI-6363 deploys the updated starr SI-6363 removes scala.reflect.base SI-6392 wraps non-terms before typecheck/eval SI-6394 fixes macros.Context.enclosingClass Error message improvement for SI-6336. Adjustments to scala.concurrent.duration. prepping for the refactoring ... Conflicts: src/actors-migration/scala/actors/Pattern.scala src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/collection/immutable/Vector.scala test/files/jvm/actmig-PinS_1.scala test/files/jvm/actmig-PinS_2.scala test/files/jvm/actmig-PinS_3.scala test/files/jvm/actmig-public-methods_1.scala
Diffstat (limited to 'src/partest')
-rw-r--r--src/partest/scala/tools/partest/CompilerTest.scala4
-rw-r--r--src/partest/scala/tools/partest/package.scala35
2 files changed, 31 insertions, 8 deletions
diff --git a/src/partest/scala/tools/partest/CompilerTest.scala b/src/partest/scala/tools/partest/CompilerTest.scala
index a1450ee876..6df0cec7fe 100644
--- a/src/partest/scala/tools/partest/CompilerTest.scala
+++ b/src/partest/scala/tools/partest/CompilerTest.scala
@@ -5,7 +5,7 @@
package scala.tools.partest
-import scala.reflect.{basis => rb}
+import scala.reflect.runtime.{universe => ru}
import scala.tools.nsc._
/** For testing compiler internals directly.
@@ -34,7 +34,7 @@ abstract class CompilerTest extends DirectTest {
// Utility functions
class MkType(sym: Symbol) {
- def apply[M](implicit t: rb.TypeTag[M]): Type =
+ def apply[M](implicit t: ru.TypeTag[M]): Type =
if (sym eq NoSymbol) NoType
else appliedType(sym, compilerTypeFromTag(t))
}
diff --git a/src/partest/scala/tools/partest/package.scala b/src/partest/scala/tools/partest/package.scala
index c288c15c19..ccceeacb0a 100644
--- a/src/partest/scala/tools/partest/package.scala
+++ b/src/partest/scala/tools/partest/package.scala
@@ -92,11 +92,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))
}
}