summaryrefslogtreecommitdiff
path: root/test/files/run/macro-def-path-dependent
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-def-path-dependent
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-def-path-dependent')
-rw-r--r--test/files/run/macro-def-path-dependent/Dummy.scala3
-rw-r--r--test/files/run/macro-def-path-dependent/Test_1.scala23
-rw-r--r--test/files/run/macro-def-path-dependent/Test_2.scala22
-rw-r--r--test/files/run/macro-def-path-dependent/Test_3.scala22
-rw-r--r--test/files/run/macro-def-path-dependent/Test_4.scala11
-rw-r--r--test/files/run/macro-def-path-dependent/Test_5.scala9
-rw-r--r--test/files/run/macro-def-path-dependent/Test_6.scala9
7 files changed, 99 insertions, 0 deletions
diff --git a/test/files/run/macro-def-path-dependent/Dummy.scala b/test/files/run/macro-def-path-dependent/Dummy.scala
new file mode 100644
index 0000000000..7dffc5107d
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent/Dummy.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ println("it works")
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent/Test_1.scala b/test/files/run/macro-def-path-dependent/Test_1.scala
new file mode 100644
index 0000000000..06c15e16c9
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent/Test_1.scala
@@ -0,0 +1,23 @@
+package test1
+
+import scala.reflect.macros.{Context => Ctx}
+
+trait Exprs {
+ self: Universe =>
+
+ class Expr[T]
+}
+
+trait Reifiers {
+ self: Universe =>
+
+ type Expr[T]
+
+ def reify[T](expr: T) = macro Impls.reify[T]
+}
+
+trait Universe extends Exprs with Reifiers
+
+object Impls {
+ def reify[T](cc: Ctx{ type PrefixType = Reifiers })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
+}
diff --git a/test/files/run/macro-def-path-dependent/Test_2.scala b/test/files/run/macro-def-path-dependent/Test_2.scala
new file mode 100644
index 0000000000..f1e9909981
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent/Test_2.scala
@@ -0,0 +1,22 @@
+package test2
+
+import scala.reflect.macros.{Context => Ctx}
+
+trait Exprs {
+ self: Universe =>
+
+ class Expr[T]
+}
+
+trait Reifiers {
+ self: Universe =>
+
+}
+
+trait Universe extends Exprs with Reifiers {
+ def reify[T](expr: T) = macro Impls.reify[T]
+}
+
+object Impls {
+ def reify[T](cc: Ctx{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
+}
diff --git a/test/files/run/macro-def-path-dependent/Test_3.scala b/test/files/run/macro-def-path-dependent/Test_3.scala
new file mode 100644
index 0000000000..9f5efe5e47
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent/Test_3.scala
@@ -0,0 +1,22 @@
+package test3
+
+import scala.reflect.macros.{Context => Ctx}
+
+trait Exprs {
+ self: Universe =>
+
+ class Expr[T]
+}
+
+trait Reifiers {
+ self: Universe =>
+
+}
+
+trait Universe extends Exprs with Reifiers {
+ def reify[T](expr: T): Expr[T] = macro Impls.reify[T]
+}
+
+object Impls {
+ def reify[T](cc: Ctx{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
+}
diff --git a/test/files/run/macro-def-path-dependent/Test_4.scala b/test/files/run/macro-def-path-dependent/Test_4.scala
new file mode 100644
index 0000000000..3af920d739
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent/Test_4.scala
@@ -0,0 +1,11 @@
+package test4
+
+import scala.reflect.runtime.universe._
+import scala.reflect.macros.Context
+import scala.reflect.api.Universe
+
+object Test {
+ def materializeTypeTag[T](u: Universe)(e: T) = macro materializeTypeTag_impl[T]
+
+ def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ???
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent/Test_5.scala b/test/files/run/macro-def-path-dependent/Test_5.scala
new file mode 100644
index 0000000000..bc32fb92de
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent/Test_5.scala
@@ -0,0 +1,9 @@
+package test56
+
+import scala.reflect.runtime.universe._
+import scala.reflect.macros.Context
+import scala.reflect.api.Universe
+
+object Impls {
+ def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ???
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent/Test_6.scala b/test/files/run/macro-def-path-dependent/Test_6.scala
new file mode 100644
index 0000000000..6267743473
--- /dev/null
+++ b/test/files/run/macro-def-path-dependent/Test_6.scala
@@ -0,0 +1,9 @@
+package test56
+
+import scala.reflect.runtime.universe._
+import scala.reflect.macros.Context
+import scala.reflect.api.Universe
+
+object Macros {
+ def materializeTypeTag[T](u: Universe)(e: T) = macro Impls.materializeTypeTag_impl[T]
+} \ No newline at end of file