summaryrefslogtreecommitdiff
path: root/test/files/run/macro-expand-nullary-nongeneric
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-01-14 23:55:25 +0100
committerEugene Burmako <xeno.by@gmail.com>2013-05-28 08:23:44 +0200
commit70f001181734f76064d97ec25b1afd6aad49b684 (patch)
treecfd16d6df0388c26a0f05f6155a53f8c499d77a7 /test/files/run/macro-expand-nullary-nongeneric
parente1d9805c91dbe74317e2f4f22ad59056d64d12b3 (diff)
downloadscala-70f001181734f76064d97ec25b1afd6aad49b684.tar.gz
scala-70f001181734f76064d97ec25b1afd6aad49b684.tar.bz2
scala-70f001181734f76064d97ec25b1afd6aad49b684.zip
refactors macro tests
putting in a nutshell, this patch: * condenses some macro-XXX-a/b/c/... bundles * renames some tests to prepare for other macro flavors * introduces some additional tests
Diffstat (limited to 'test/files/run/macro-expand-nullary-nongeneric')
-rw-r--r--test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
index 41e50acc86..d23c671c84 100644
--- a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
+++ b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
@@ -1,14 +1,15 @@
+import scala.reflect.runtime.universe._
import scala.reflect.macros.{Context => Ctx}
object Impls {
- def impl(c: Ctx) = {
+ def impl(c: Ctx)(meth: String) = {
import c.universe._
- val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))
+ val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(meth))))
c.Expr[Unit](body)
}
- def fooNullary(c: Ctx) = impl(c)
- def fooEmpty(c: Ctx)() = impl(c)
- def barNullary(c: Ctx)(x: c.Expr[Int]) = impl(c)
- def barEmpty(c: Ctx)(x: c.Expr[Int])() = impl(c)
+ def fooNullary(c: Ctx) = impl(c)("fooNullary")
+ def fooEmpty(c: Ctx)() = impl(c)("fooEmpty")
+ def barNullary(c: Ctx)(x: c.Expr[Int]) = impl(c)("barNullary")
+ def barEmpty(c: Ctx)(x: c.Expr[Int])() = impl(c)("barEmpty")
} \ No newline at end of file