diff options
Diffstat (limited to 'tests/disabled/macro/run/reify_closure2a.scala')
-rw-r--r-- | tests/disabled/macro/run/reify_closure2a.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/disabled/macro/run/reify_closure2a.scala b/tests/disabled/macro/run/reify_closure2a.scala new file mode 100644 index 000000000..cc194bc6d --- /dev/null +++ b/tests/disabled/macro/run/reify_closure2a.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo(y: Int): Int => Int = { + val fun = reify{(x: Int) => { + x + y + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(1)(10)) + println(foo(2)(10)) +} |