blob: f2ca2d496d6e8b3b9a17ae9b1111d9eb4b0345f9 (
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
import scala.tools.reflect.Eval
object Test extends App {
val code = reify {
object C { def qwe = 4 }
case class C(foo: Int, bar: Int)
val c = C(2, 2)
println(c.foo * c.bar == C.qwe)
};
val toolbox = cm.mkToolBox()
println(code.tree)
println(code.eval)
}
|