Skip to content

Instantly share code, notes, and snippets.

@xeno-by
Created December 9, 2011 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xeno-by/1453452 to your computer and use it in GitHub Desktop.
Save xeno-by/1453452 to your computer and use it in GitHub Desktop.
lifted code that uses non-bound syms: works
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{
println(List(1).map(x => x).length)
};
val reporter = new ConsoleReporter(new Settings)
val toolbox = new ToolBox(reporter)
val ttree = toolbox.typeCheck(code.tree)
toolbox.runExpr(ttree)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment