diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-09-26 08:48:26 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-09-27 15:49:03 +0200 |
commit | e9fbb661a3deb6e6234bdf94dce6fa98a205f3ca (patch) | |
tree | fba72faa84d814735024081a1cd1644e9c75e9da /test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala | |
parent | 1839c1b5528e706c280e7d81031499f3d46826ec (diff) | |
download | scala-e9fbb661a3deb6e6234bdf94dce6fa98a205f3ca.tar.gz scala-e9fbb661a3deb6e6234bdf94dce6fa98a205f3ca.tar.bz2 scala-e9fbb661a3deb6e6234bdf94dce6fa98a205f3ca.zip |
removes extraneous stuff from macros.Infrastructure
libraryClassLoader can be derived from currentClassPath
currentMacro can be trivially derived from macroApplication
Backend-detection methods forXXX (as in forJVM or forScaladoc)
might be useful, but current design of this API is not future-proof.
I'm not able to come up with a better design on the spot, so
let's remove this functionality for the moment.
Diffstat (limited to 'test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala')
-rw-r--r-- | test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala b/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala index b23a5c70e1..5330d0e32b 100644 --- a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala +++ b/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala @@ -4,18 +4,7 @@ object Impls { def foo(c: Ctx)(x: c.Expr[Int]) = { val x1 = c.Expr[Int](c.resetAllAttrs(x.tree)) // was: c.literal(x1.splice) - c.literal(eval(c)(x1)) - } - - private def eval[T](c: Ctx)(x: c.Expr[T]): T = { - import scala.reflect.runtime.{universe => ru} - val mirror = ru.runtimeMirror(c.libraryClassLoader) - import scala.tools.reflect.ToolBox - val toolBox = mirror.mkToolBox() - val importer = ru.mkImporter(c.universe).asInstanceOf[ru.Importer { val from: c.universe.type }] - val tree = c.resetAllAttrs(x.tree.duplicate) - val imported = importer.importTree(tree) - toolBox.eval(imported).asInstanceOf[T] + c.literal(c.eval(x1)) } } |