diff options
Diffstat (limited to 'test/files/run/t8437')
-rw-r--r-- | test/files/run/t8437/Macros_1.scala | 18 | ||||
-rw-r--r-- | test/files/run/t8437/Test_2.scala | 4 |
2 files changed, 22 insertions, 0 deletions
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 |