summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-03-25 20:18:15 +0100
committerEugene Burmako <xeno.by@gmail.com>2014-03-25 20:18:15 +0100
commitc34826d1ca183a29f73eb056f69c59a50091ec4d (patch)
treef6a5c80dc44a7f189bc062fc67d1bc0e9d4a720b /test
parentc765537cb3532a7b88f1b68331840953f3e9d048 (diff)
parent932626471f90c038511647400518d8c32607315b (diff)
downloadscala-c34826d1ca183a29f73eb056f69c59a50091ec4d.tar.gz
scala-c34826d1ca183a29f73eb056f69c59a50091ec4d.tar.bz2
scala-c34826d1ca183a29f73eb056f69c59a50091ec4d.zip
Merge pull request #3651 from xeno-by/ticket/8437
SI-8437 macro runtime now also picks inherited macro implementations
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t8437.check2
-rw-r--r--test/files/run/t8437/Macros_1.scala18
-rw-r--r--test/files/run/t8437/Test_2.scala4
3 files changed, 24 insertions, 0 deletions
diff --git a/test/files/run/t8437.check b/test/files/run/t8437.check
new file mode 100644
index 0000000000..fd3c81a4d7
--- /dev/null
+++ b/test/files/run/t8437.check
@@ -0,0 +1,2 @@
+5
+5
diff --git a/test/files/run/t8437/Macros_1.scala b/test/files/run/t8437/Macros_1.scala
new file mode 100644
index 0000000000..6286ea2a8c
--- /dev/null
+++ b/test/files/run/t8437/Macros_1.scala
@@ -0,0 +1,18 @@
+import scala.language.experimental.macros
+import scala.reflect.macros._
+
+abstract class AbstractBundle(val c: blackbox.Context) {
+ import c.Expr
+ import c.universe._
+ def foo: Expr[Int] = Expr[Int](q"5")
+}
+
+class ConcreteBundle(override val c: blackbox.Context) extends AbstractBundle(c) {
+ import c.Expr
+ val bar: Expr[Int] = foo
+}
+
+object InvokeBundle {
+ def foo: Int = macro ConcreteBundle.foo // nope
+ def bar: Int = macro ConcreteBundle.bar // yep
+} \ No newline at end of file
diff --git a/test/files/run/t8437/Test_2.scala b/test/files/run/t8437/Test_2.scala
new file mode 100644
index 0000000000..47bb84ad0e
--- /dev/null
+++ b/test/files/run/t8437/Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ println(InvokeBundle.foo)
+ println(InvokeBundle.bar)
+} \ No newline at end of file