From a6d6550826c3fbd04948382893ce3147d298ffbc Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Fri, 18 Oct 2013 16:52:28 +0200 Subject: changes some manual tree constructions in macro tests to quasiquotes --- test/files/pos/annotated-treecopy/Impls_Macros_1.scala | 6 +++--- test/files/pos/t5692a/Macros_1.scala | 2 +- test/files/pos/t5692b/Macros_1.scala | 2 +- test/files/pos/t7461/Macros_1.scala | 2 +- test/files/pos/t7649.scala | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/files/pos') diff --git a/test/files/pos/annotated-treecopy/Impls_Macros_1.scala b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala index 407d0b4bf3..9b7af0c3b8 100644 --- a/test/files/pos/annotated-treecopy/Impls_Macros_1.scala +++ b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala @@ -38,10 +38,10 @@ object Macros { val reifiedExpr = c.Expr[scala.reflect.runtime.universe.Expr[T => U]](reifiedTree) val template = c.universe.reify(new (T => U) with TypedFunction { - override def toString = c.Expr[String](Literal(Constant(tp+" => "+ttag.tpe+" { "+b1.toString+" } "))).splice // DEBUG + override def toString = c.Expr[String](q"""${tp+" => "+ttag.tpe+" { "+b1.toString+" } "}""").splice // DEBUG def tree = reifiedExpr.splice.tree - val typeIn = c.Expr[String](Literal(Constant((tp.toString)))).splice - val typeOut = c.Expr[String](Literal(Constant((ttag.tpe.toString)))).splice + val typeIn = c.Expr[String](q"${tp.toString}").splice + val typeOut = c.Expr[String](q"${ttag.tpe.toString}").splice def apply(_arg: T): U = c.Expr[U](b1)(ttag.asInstanceOf[c.WeakTypeTag[U]]).splice }) val untyped = c.resetLocalAttrs(template.tree) diff --git a/test/files/pos/t5692a/Macros_1.scala b/test/files/pos/t5692a/Macros_1.scala index fa3a0bcf32..e530713bb0 100644 --- a/test/files/pos/t5692a/Macros_1.scala +++ b/test/files/pos/t5692a/Macros_1.scala @@ -1,6 +1,6 @@ import scala.reflect.macros.Context object Macros { - def impl[T](c: Context) = { import c.universe._; c.Expr[Unit](Literal(Constant(()))) } + def impl[T](c: Context) = { import c.universe._; c.Expr[Unit](q"()") } def foo[T] = macro impl[T] } \ No newline at end of file diff --git a/test/files/pos/t5692b/Macros_1.scala b/test/files/pos/t5692b/Macros_1.scala index 12108cfefa..45c672cfce 100644 --- a/test/files/pos/t5692b/Macros_1.scala +++ b/test/files/pos/t5692b/Macros_1.scala @@ -1,6 +1,6 @@ import scala.reflect.macros.Context object Macros { - def impl[T, U](c: Context) = { import c.universe._; c.Expr[Unit](Literal(Constant(()))) } + def impl[T, U](c: Context) = { import c.universe._; c.Expr[Unit](q"()") } def foo[T, U] = macro impl[T, U] } \ No newline at end of file diff --git a/test/files/pos/t7461/Macros_1.scala b/test/files/pos/t7461/Macros_1.scala index fdaf33e8c8..8621650f77 100644 --- a/test/files/pos/t7461/Macros_1.scala +++ b/test/files/pos/t7461/Macros_1.scala @@ -6,7 +6,7 @@ object Macros { import c.universe._ val wut = c.typeCheck(Select(Literal(Constant(10)), newTermName("$minus")), silent = true) // println(showRaw(wut, printIds = true, printTypes = true)) - c.Expr[Unit](Literal(Constant(()))) + c.Expr[Unit](q"()") } def foo = macro impl diff --git a/test/files/pos/t7649.scala b/test/files/pos/t7649.scala index a1b02f63f1..ff3c626fca 100644 --- a/test/files/pos/t7649.scala +++ b/test/files/pos/t7649.scala @@ -4,7 +4,7 @@ object Test { reify { // The lookup of the implicit WeakTypeTag[Any] // was triggering an unpositioned tree. - c.Expr[Any](Literal(Constant(0))).splice + c.Expr[Any](q"0").splice } import scala.reflect.ClassTag -- cgit v1.2.3