blob: 6b97b42b34477f8b5100de840061a5841c5207bd (
plain) (
tree)
|
|
import scala.tools.nsc.reporters._
import scala.tools.nsc.Settings
import reflect.runtime.Mirror.ToolBox
object Test extends App {
val code = scala.reflect.Code.lift{
object C {
class D {
val x = 2
}
}
val outer = C
val inner = new outer.D
println(inner.x)
};
val reporter = new ConsoleReporter(new Settings)
val toolbox = new ToolBox(reporter)
val ttree = toolbox.typeCheck(code.tree)
toolbox.runExpr(ttree)
}
|