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:
parent
78a78d9942
commit
ed167e7120
|
|
@ -0,0 +1 @@
|
|||
evaluated = 2
|
||||
|
|
@ -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)
|
||||
}
|
||||
Loading…
Reference in New Issue