From 597a949e8700d585dc89979b66375367ac73acc2 Mon Sep 17 00:00:00 2001 From: martende Date: Tue, 27 Nov 2012 14:08:53 +0100 Subject: SI-5753 macros cannot be loaded when inherited from a class or a trait enclClass should be taken from Tree otherwise we can jump to declaration class/trait. --- test/files/run/t5753_2/Impls_Macros_1.scala | 10 ++++++++++ test/files/run/t5753_2/Test_2.scala | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 test/files/run/t5753_2/Impls_Macros_1.scala create mode 100644 test/files/run/t5753_2/Test_2.scala (limited to 'test/files/run/t5753_2') diff --git a/test/files/run/t5753_2/Impls_Macros_1.scala b/test/files/run/t5753_2/Impls_Macros_1.scala new file mode 100644 index 0000000000..e23c0b938b --- /dev/null +++ b/test/files/run/t5753_2/Impls_Macros_1.scala @@ -0,0 +1,10 @@ +import scala.reflect.macros.{Context => Ctx} + +trait Macro_T { + def foo[T](c: Ctx)(s: c.Expr[T]) = s +} + +object Macros { + def foo[T](s: T) = macro Impls.foo[T] + object Impls extends Macro_T +} diff --git a/test/files/run/t5753_2/Test_2.scala b/test/files/run/t5753_2/Test_2.scala new file mode 100644 index 0000000000..a2777638bc --- /dev/null +++ b/test/files/run/t5753_2/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + import Macros._ + println(foo(42)) +} \ No newline at end of file -- cgit v1.2.3