summaryrefslogtreecommitdiff
path: root/test/files/run/reify_closure8a.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/reify_closure8a.scala')
-rw-r--r--test/files/run/reify_closure8a.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/run/reify_closure8a.scala b/test/files/run/reify_closure8a.scala
new file mode 100644
index 0000000000..805d8ff855
--- /dev/null
+++ b/test/files/run/reify_closure8a.scala
@@ -0,0 +1,16 @@
+import scala.reflect.Code._
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ class Foo(val y: Int) {
+ def fun = lift{y}
+ }
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val dyn = toolbox.runExpr(new Foo(10).fun.tree)
+ val foo = dyn.asInstanceOf[Int]
+ println(foo)
+}