summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-10-18 16:52:28 +0200
committerEugene Burmako <xeno.by@gmail.com>2013-10-18 16:59:18 +0200
commita6d6550826c3fbd04948382893ce3147d298ffbc (patch)
tree0aa749c13ed646d8379f7e0ee037d87c97180f76 /test/files/pos
parent3b4dc75710ac51de729224929690422d1b44e3ad (diff)
downloadscala-a6d6550826c3fbd04948382893ce3147d298ffbc.tar.gz
scala-a6d6550826c3fbd04948382893ce3147d298ffbc.tar.bz2
scala-a6d6550826c3fbd04948382893ce3147d298ffbc.zip
changes some manual tree constructions in macro tests to quasiquotes
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/annotated-treecopy/Impls_Macros_1.scala6
-rw-r--r--test/files/pos/t5692a/Macros_1.scala2
-rw-r--r--test/files/pos/t5692b/Macros_1.scala2
-rw-r--r--test/files/pos/t7461/Macros_1.scala2
-rw-r--r--test/files/pos/t7649.scala2
5 files changed, 7 insertions, 7 deletions
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