summaryrefslogtreecommitdiff
path: root/test/files/run/macro-reify-freevars
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-06-04 13:53:13 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-06-08 15:32:17 +0200
commit7b0f0a142bb526f4bd108a8c208ec9a8952398c9 (patch)
treeee13d036756be41521a9eb3f1e05898410ab744e /test/files/run/macro-reify-freevars
parentd9103e01b467634d61baa3b131aeb93fca9e20a5 (diff)
downloadscala-7b0f0a142bb526f4bd108a8c208ec9a8952398c9.tar.gz
scala-7b0f0a142bb526f4bd108a8c208ec9a8952398c9.tar.bz2
scala-7b0f0a142bb526f4bd108a8c208ec9a8952398c9.zip
repairs the tests after the refactoring spree
Diffstat (limited to 'test/files/run/macro-reify-freevars')
-rw-r--r--test/files/run/macro-reify-freevars/Macros_1.scala11
-rw-r--r--test/files/run/macro-reify-freevars/Test_2.scala6
2 files changed, 10 insertions, 7 deletions
diff --git a/test/files/run/macro-reify-freevars/Macros_1.scala b/test/files/run/macro-reify-freevars/Macros_1.scala
index 3cc559a0af..eafc7f9a82 100644
--- a/test/files/run/macro-reify-freevars/Macros_1.scala
+++ b/test/files/run/macro-reify-freevars/Macros_1.scala
@@ -1,13 +1,14 @@
package scala.collection.slick
+
object QueryableMacros{
def map[T:c.TypeTag, S:c.TypeTag]
(c: scala.reflect.makro.Context)
- (projection: c.mirror.Expr[T => S])
- : c.mirror.Expr[scala.collection.slick.Queryable[S]] = {
- import c.mirror._
+ (projection: c.Expr[T => S])
+ : c.Expr[scala.collection.slick.Queryable[S]] = {
+ import c.universe._
val code = EmptyTree
c.reify{
- Queryable.factory[S]( code.asInstanceOf[reflect.mirror.Tree] )
+ Queryable.factory[S]( code.asInstanceOf[reflect.runtime.universe.Tree] )
}
}
}
@@ -15,5 +16,5 @@ class Queryable[T]{
def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S]
}
object Queryable{
- def factory[S]( projection:scala.reflect.mirror.Tree ) : Queryable[S] = null
+ def factory[S]( projection:reflect.runtime.universe.Tree ) : Queryable[S] = null
} \ No newline at end of file
diff --git a/test/files/run/macro-reify-freevars/Test_2.scala b/test/files/run/macro-reify-freevars/Test_2.scala
index e7077f9c7f..603cf10d41 100644
--- a/test/files/run/macro-reify-freevars/Test_2.scala
+++ b/test/files/run/macro-reify-freevars/Test_2.scala
@@ -1,9 +1,11 @@
object Test extends App {
- import scala.reflect.mirror._
+ import scala.reflect.runtime.universe._
+ import scala.reflect.runtime.{currentMirror => cm}
+ import scala.tools.reflect.ToolBox
val q = New(AppliedTypeTree(Select(Select(Select(Ident("scala"), newTermName("collection")), newTermName("slick")), newTypeName("Queryable")), List(Ident("Int"))))
val x = ValDef(NoMods, newTermName("x"), Ident("Int"), EmptyTree)
val fn = Function(List(x), Apply(Select(Ident(newTermName("x")), newTermName("$plus")), List(Literal(Constant("5")))))
val tree = Apply(Select(q, newTermName("map")), List(fn))
- try Expr(tree).eval
+ try cm.mkToolBox().runExpr(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file