summaryrefslogtreecommitdiff
path: root/test/pending/run/reify_closure9b.scala
blob: a6920b4e024a9da545bb9378af802bedcf4b9c63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 App {
  def foo(y: Int) = {
    class Foo(y: Int) {
      def fun = reify{y}
    }

    val toolbox = cm.mkToolBox()
    val dyn = toolbox.eval(new Foo(y).fun.tree)
    dyn.asInstanceOf[Int]
  }

  println(foo(10))
}