summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-04-25 19:37:26 +0300
committerEugene Burmako <xeno.by@gmail.com>2012-04-25 20:32:55 +0300
commit79dfed0baabd14394ba078b62c7418ae0e738603 (patch)
treef58168c14cc93f4be4cfe924fdb254750e4e9ff5 /test/files/run
parent5cf9499731255078de62c8f3704fa596b564bf0e (diff)
downloadscala-79dfed0baabd14394ba078b62c7418ae0e738603.tar.gz
scala-79dfed0baabd14394ba078b62c7418ae0e738603.tar.bz2
scala-79dfed0baabd14394ba078b62c7418ae0e738603.zip
removes Expr <-> Tree implicits
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/macro-abort-fresh/Test_2.scala2
-rw-r--r--test/files/run/macro-basic-mamd-mi/Impls_1.scala4
-rw-r--r--test/files/run/macro-def-infer-return-type-b/Test_2.scala2
-rw-r--r--test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala5
-rw-r--r--test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala5
-rw-r--r--test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala5
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala2
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala2
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidret-nontypeable/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidusage-badret/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidusage-partialapplication/Test_2.scala2
-rw-r--r--test/files/run/macro-range/Expansion_Impossible_2.scala10
-rw-r--r--test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala2
-rw-r--r--test/files/run/macro-reify-eval-outside-reify/Test_2.scala2
-rw-r--r--test/files/run/macro-reify-freevars/Test_2.scala2
-rw-r--r--test/files/run/macro-reify-tagless-a/Test_2.scala2
-rw-r--r--test/files/run/macro-reify-value-outside-reify/Test_2.scala2
-rw-r--r--test/files/run/reify_newimpl_45.scala6
-rw-r--r--test/files/run/t5704.scala32
-rw-r--r--test/files/run/toolbox_default_reporter_is_silent.scala2
-rw-r--r--test/files/run/toolbox_silent_reporter.scala2
25 files changed, 50 insertions, 59 deletions
diff --git a/test/files/run/macro-abort-fresh/Test_2.scala b/test/files/run/macro-abort-fresh/Test_2.scala
index f389231ca6..ecf48b9752 100644
--- a/test/files/run/macro-abort-fresh/Test_2.scala
+++ b/test/files/run/macro-abort-fresh/Test_2.scala
@@ -1,6 +1,6 @@
object Test extends App {
import scala.reflect.mirror._
val tree = Select(Ident("Macros"), newTermName("foo"))
- try tree.eval
+ try Expr(tree).eval
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-basic-mamd-mi/Impls_1.scala b/test/files/run/macro-basic-mamd-mi/Impls_1.scala
index eadb63fa8e..82d2cce2f5 100644
--- a/test/files/run/macro-basic-mamd-mi/Impls_1.scala
+++ b/test/files/run/macro-basic-mamd-mi/Impls_1.scala
@@ -3,12 +3,12 @@ import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
import c.mirror._
- Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
+ Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))))
}
def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
import c.mirror._
- Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
+ Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2)))))
}
def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
diff --git a/test/files/run/macro-def-infer-return-type-b/Test_2.scala b/test/files/run/macro-def-infer-return-type-b/Test_2.scala
index 8ff4494750..f8f15b4224 100644
--- a/test/files/run/macro-def-infer-return-type-b/Test_2.scala
+++ b/test/files/run/macro-def-infer-return-type-b/Test_2.scala
@@ -1,6 +1,6 @@
object Test extends App {
import scala.reflect.mirror._
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- try tree.eval
+ try Expr(tree).eval
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala b/test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala
index 4cd98c5838..5019d5d4a7 100644
--- a/test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala
+++ b/test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala
@@ -1,8 +1,5 @@
import scala.reflect.makro.{Context => Ctx}
object Impls {
- def foo[U <: String](c: Ctx): c.Expr[Unit] = {
- import c.mirror._
- Literal(Constant(()))
- }
+ def foo[U <: String](c: Ctx): c.Expr[Unit] = c.literalUnit
}
diff --git a/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala b/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala
index 9103ddb08a..abd68696b6 100644
--- a/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala
+++ b/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala
@@ -3,8 +3,5 @@ import scala.reflect.makro.{Context => Ctx}
class C
object Impls {
- def foo[U <: C](c: Ctx): c.Expr[Unit] = {
- import c.mirror._
- Literal(Constant(()))
- }
+ def foo[U <: C](c: Ctx): c.Expr[Unit] = c.literalUnit
}
diff --git a/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala b/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala
index 4cd98c5838..5019d5d4a7 100644
--- a/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala
+++ b/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala
@@ -1,8 +1,5 @@
import scala.reflect.makro.{Context => Ctx}
object Impls {
- def foo[U <: String](c: Ctx): c.Expr[Unit] = {
- import c.mirror._
- Literal(Constant(()))
- }
+ def foo[U <: String](c: Ctx): c.Expr[Unit] = c.literalUnit
}
diff --git a/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala
index bc880fdf77..4da5a9b823 100644
--- a/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala
+++ b/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala
@@ -3,10 +3,10 @@ import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo[T, U: c.TypeTag, V](c: Ctx)(implicit T: c.TypeTag[T], V: c.TypeTag[V]): c.Expr[Unit] = {
import c.mirror._
- Block(List(
+ Expr(Block(List(
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))),
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.TypeTag[U]].toString)))),
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))),
- Literal(Constant(())))
+ Literal(Constant(()))))
}
}
diff --git a/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala b/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala
index c83e401afb..4d137a4aef 100644
--- a/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala
+++ b/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala
@@ -3,11 +3,11 @@ import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo[T, U: c.TypeTag, V](c: Ctx)(implicit T: c.TypeTag[T], V: c.TypeTag[V]): c.Expr[Unit] = {
import c.mirror._
- Block(List(
+ Expr(Block(List(
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))),
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.TypeTag[U]].toString)))),
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))),
- Literal(Constant(())))
+ Literal(Constant(()))))
}
}
diff --git a/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala
index bc880fdf77..4da5a9b823 100644
--- a/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala
+++ b/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala
@@ -3,10 +3,10 @@ import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo[T, U: c.TypeTag, V](c: Ctx)(implicit T: c.TypeTag[T], V: c.TypeTag[V]): c.Expr[Unit] = {
import c.mirror._
- Block(List(
+ Expr(Block(List(
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))),
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.TypeTag[U]].toString)))),
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))),
- Literal(Constant(())))
+ Literal(Constant(()))))
}
}
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
index 523c6b0645..01fc9d4462 100644
--- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
@@ -5,6 +5,6 @@ object Macros {
object Test extends App {
import scala.reflect.mirror._
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(tpnme.WILDCARD_STAR))))
- try tree.eval
+ try Expr(tree).eval
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala
index 882867fcab..828ccf34e2 100644
--- a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala
@@ -3,7 +3,7 @@ import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo(c: Ctx): c.Expr[Int] = {
import c.mirror._
- Literal(Constant("42"))
+ Expr(Literal(Constant("42")))
}
}
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
index f389231ca6..ecf48b9752 100644
--- a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
@@ -1,6 +1,6 @@
object Test extends App {
import scala.reflect.mirror._
val tree = Select(Ident("Macros"), newTermName("foo"))
- try tree.eval
+ try Expr(tree).eval
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-nontypeable/Test_2.scala b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
index f389231ca6..ecf48b9752 100644
--- a/test/files/run/macro-invalidret-nontypeable/Test_2.scala
+++ b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
@@ -1,6 +1,6 @@
object Test extends App {
import scala.reflect.mirror._
val tree = Select(Ident("Macros"), newTermName("foo"))
- try tree.eval
+ try Expr(tree).eval
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidusage-badret/Test_2.scala b/test/files/run/macro-invalidusage-badret/Test_2.scala
index e171c9d05a..aeb3c26eaa 100644
--- a/test/files/run/macro-invalidusage-badret/Test_2.scala
+++ b/test/files/run/macro-invalidusage-badret/Test_2.scala
@@ -1,6 +1,6 @@
object Test extends App {
import scala.reflect.mirror._
val tree = Typed(Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42)))), Ident(newTypeName("String")))
- try tree.eval
+ try Expr(tree).eval
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
index 63371a4a82..293d906048 100644
--- a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
+++ b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
@@ -1,6 +1,6 @@
object Test extends App {
import scala.reflect.mirror._
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(40))))
- try tree.eval
+ try Expr(tree).eval
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-range/Expansion_Impossible_2.scala b/test/files/run/macro-range/Expansion_Impossible_2.scala
index 7a093b74ee..051afff99c 100644
--- a/test/files/run/macro-range/Expansion_Impossible_2.scala
+++ b/test/files/run/macro-range/Expansion_Impossible_2.scala
@@ -14,7 +14,7 @@ object Impls {
// scala"{ var i = $low; val h = $hi; while (i < h) { $f(i); i = i + 1 } }
// or:
// scala"($_this: RangeDefault).foreach($f)"
- c.prefix.tree match {
+ Expr(c.prefix.tree match {
case Apply(Select(New(tpt), initName), List(lo, hi)) if tpt.symbol.fullName == "Range" =>
val iname = newTermName("$i")
val hname = newTermName("$h")
@@ -23,7 +23,7 @@ object Impls {
val labelname = newTermName("$while")
val cond = makeBinop(iref, "$less", href)
val body = Block(
- List(makeApply(f, List(iref))),
+ List(makeApply(f.tree, List(iref))),
Assign(iref, makeBinop(iref, "$plus", Literal(Constant(1)))))
val generated =
Block(
@@ -37,10 +37,10 @@ object Impls {
case _ =>
Apply(
Select(
- Typed(c.prefix, Ident(newTypeName("RangeDefault"))),
+ Typed(c.prefix.tree, Ident(newTypeName("RangeDefault"))),
newTermName("foreach")),
- List(f))
- }
+ List(f.tree))
+ })
}
}
diff --git a/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
index 3c594aed75..632708a125 100644
--- a/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
+++ b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
@@ -1,5 +1,5 @@
object Test extends App {
import scala.reflect.mirror._
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- println(tree.eval)
+ println(Expr(tree).eval)
}
diff --git a/test/files/run/macro-reify-eval-outside-reify/Test_2.scala b/test/files/run/macro-reify-eval-outside-reify/Test_2.scala
index 3c594aed75..632708a125 100644
--- a/test/files/run/macro-reify-eval-outside-reify/Test_2.scala
+++ b/test/files/run/macro-reify-eval-outside-reify/Test_2.scala
@@ -1,5 +1,5 @@
object Test extends App {
import scala.reflect.mirror._
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- println(tree.eval)
+ println(Expr(tree).eval)
}
diff --git a/test/files/run/macro-reify-freevars/Test_2.scala b/test/files/run/macro-reify-freevars/Test_2.scala
index 55c677155a..e7077f9c7f 100644
--- a/test/files/run/macro-reify-freevars/Test_2.scala
+++ b/test/files/run/macro-reify-freevars/Test_2.scala
@@ -4,6 +4,6 @@ object Test extends App {
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 tree.eval
+ try Expr(tree).eval
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-reify-tagless-a/Test_2.scala b/test/files/run/macro-reify-tagless-a/Test_2.scala
index d996da1570..94efbd0c37 100644
--- a/test/files/run/macro-reify-tagless-a/Test_2.scala
+++ b/test/files/run/macro-reify-tagless-a/Test_2.scala
@@ -7,6 +7,6 @@ object Test extends App {
val rhs = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant("hello world"))))
val list = ValDef(NoMods, newTermName("list"), tpt, rhs)
val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name))))
- try tree.eval
+ try Expr(tree).eval
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-reify-value-outside-reify/Test_2.scala b/test/files/run/macro-reify-value-outside-reify/Test_2.scala
index 8225eb0b39..128cad4510 100644
--- a/test/files/run/macro-reify-value-outside-reify/Test_2.scala
+++ b/test/files/run/macro-reify-value-outside-reify/Test_2.scala
@@ -1,6 +1,6 @@
object Test extends App {
import scala.reflect.mirror._
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- try println(tree.eval)
+ try println(Expr(tree).eval)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/reify_newimpl_45.scala b/test/files/run/reify_newimpl_45.scala
index 241b7d4bc3..b2b52eaf5b 100644
--- a/test/files/run/reify_newimpl_45.scala
+++ b/test/files/run/reify_newimpl_45.scala
@@ -3,9 +3,9 @@ import scala.reflect.mirror._
object Test extends App {
class C[T >: Null] {
val code = reify{val x: T = "2".asInstanceOf[T]; println("ima worx: %s".format(x)); x}
- println(freeTypes(code))
- val T = freeTypes(code)(0)
- mkToolBox().runExpr(code, Map(T -> definitions.StringClass.asType))
+ println(freeTypes(code.tree))
+ val T = freeTypes(code.tree)(0)
+ mkToolBox().runExpr(code.tree, Map(T -> definitions.StringClass.asType))
}
new C[String]
diff --git a/test/files/run/t5704.scala b/test/files/run/t5704.scala
index 25a6575dc3..8fd721d4e7 100644
--- a/test/files/run/t5704.scala
+++ b/test/files/run/t5704.scala
@@ -1,16 +1,16 @@
-import scala.reflect.mirror._
-
-object Test extends App {
- class MyQuerycollection{
- def findUserByName( name:String ) = {
- val tree = reify{ "test" == name }
- val toolbox = mkToolBox()
- toolbox.typeCheck(tree) match{
- case Apply(Select(lhs,op),rhs::Nil) =>
- println(rhs.tpe)
- }
- }
- }
- val qc = new MyQuerycollection
- qc.findUserByName("some value")
-}
+import scala.reflect.mirror._
+
+object Test extends App {
+ class MyQuerycollection{
+ def findUserByName( name:String ) = {
+ val tree = reify{ "test" == name }.tree
+ val toolbox = mkToolBox()
+ toolbox.typeCheck(tree) match{
+ case Apply(Select(lhs,op),rhs::Nil) =>
+ println(rhs.tpe)
+ }
+ }
+ }
+ val qc = new MyQuerycollection
+ qc.findUserByName("some value")
+}
diff --git a/test/files/run/toolbox_default_reporter_is_silent.scala b/test/files/run/toolbox_default_reporter_is_silent.scala
index 78606e2abc..6908c001a3 100644
--- a/test/files/run/toolbox_default_reporter_is_silent.scala
+++ b/test/files/run/toolbox_default_reporter_is_silent.scala
@@ -9,5 +9,5 @@ object Test extends App {
}
Utils.foo
- })
+ }.tree)
}
diff --git a/test/files/run/toolbox_silent_reporter.scala b/test/files/run/toolbox_silent_reporter.scala
index 5f264f7d74..6f5687ba4f 100644
--- a/test/files/run/toolbox_silent_reporter.scala
+++ b/test/files/run/toolbox_silent_reporter.scala
@@ -9,7 +9,7 @@ object Test extends App {
}
Utils.foo
- })
+ }.tree)
println("============compiler messages============")
toolbox.frontEnd.infos.foreach(println(_))
println("=========================================")