blob: 882287f033ad1ae941462435df36acc41ee4c760 (
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{
2 match {
case 2 => println("okay")
case _ => println("not okay")
}
};
val reporter = new ConsoleReporter(new Settings)
val toolbox = new ToolBox(reporter)
toolbox.runExpr(code.tree)
}
|