summaryrefslogblamecommitdiff
path: root/test/files/run/reify_closure8a.scala
blob: 805d8ff855c9b6e1cecc76bfe263b91e6d176b0e (plain) (tree)
1
2
3
4
5
6
7
8
9
                           




                                     


                         


                                                  
                                                 

                                 
 
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)
}