Created
December 9, 2011 21:48
-
-
Save xeno-by/1453452 to your computer and use it in GitHub Desktop.
lifted code that uses non-bound syms: works
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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