Test for SI-5230

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@26086 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
burmako 2011-11-29 14:45:17 +00:00
parent 78a78d9942
commit ed167e7120
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1 @@
evaluated = 2

View File

@ -0,0 +1,19 @@
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{
class C {
val x = 2
}
println(new C().x)
};
val reporter = new ConsoleReporter(new Settings)
val toolbox = new ToolBox(reporter)
val ttree = toolbox.typeCheck(code.tree)
val evaluated = toolbox.runExpr(ttree)
println("evaluated = " + evaluated)
}