diff options
author | Paul Phillips <paulp@improving.org> | 2012-04-12 15:23:51 +0100 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-04-12 15:23:51 +0100 |
commit | e4976678fa7479c2a44f19b00cb691dc5b881609 (patch) | |
tree | 5b6749880f8662548979f5e57509258971854500 /test/files/run/macro-reify-value-outside-reify | |
parent | f9e8a8c13ff6f75f330766ae6e0febe431fc4b12 (diff) | |
parent | 46d0d73f66111d5d31b9fd593972970d7e9056bb (diff) | |
download | scala-e4976678fa7479c2a44f19b00cb691dc5b881609.tar.gz scala-e4976678fa7479c2a44f19b00cb691dc5b881609.tar.bz2 scala-e4976678fa7479c2a44f19b00cb691dc5b881609.zip |
Merge commit 'refs/pull/375/head' into develop
Diffstat (limited to 'test/files/run/macro-reify-value-outside-reify')
-rw-r--r-- | test/files/run/macro-reify-value-outside-reify/Impls_Macros_1.scala | 9 | ||||
-rw-r--r-- | test/files/run/macro-reify-value-outside-reify/Test_2.scala | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/macro-reify-value-outside-reify/Impls_Macros_1.scala b/test/files/run/macro-reify-value-outside-reify/Impls_Macros_1.scala new file mode 100644 index 0000000000..28ec1ace67 --- /dev/null +++ b/test/files/run/macro-reify-value-outside-reify/Impls_Macros_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.makro.{Context => Ctx} + +object Impls { + def foo(c: Ctx)(x: c.Expr[Int]) = c.literal(x.value) +} + +object Macros { + def foo(x: Int) = macro Impls.foo +} diff --git a/test/files/run/macro-reify-value-outside-reify/Test_2.scala b/test/files/run/macro-reify-value-outside-reify/Test_2.scala new file mode 100644 index 0000000000..8225eb0b39 --- /dev/null +++ b/test/files/run/macro-reify-value-outside-reify/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends App { + import scala.reflect.mirror._ + val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42)))) + try println(tree.eval) + catch { case ex: Throwable => println(ex.getMessage) } +} |