blob: 32b05d00ee36c74c1b589bb342e2488113cf3e40 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import scala.reflect.mirror._
object Test extends App {
def foo(y: Int) = {
class Foo(y: Int) {
def fun = reify{y}
}
val toolbox = mkToolBox()
val dyn = toolbox.runExpr(new Foo(y).fun.tree)
dyn.asInstanceOf[Int]
}
println(foo(10))
}
|