From ed167e71201b8817bcd0897f08f14a7f809da30f Mon Sep 17 00:00:00 2001 From: burmako Date: Tue, 29 Nov 2011 14:45:17 +0000 Subject: [PATCH] Test for SI-5230 git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@26086 5e8d7ff9-d8ef-0310-90f0-a4852d11357a --- test/files/run/t5230.check | 1 + test/files/run/t5230.scala | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/files/run/t5230.check create mode 100644 test/files/run/t5230.scala diff --git a/test/files/run/t5230.check b/test/files/run/t5230.check new file mode 100644 index 000000000..5ef4ff4d0 --- /dev/null +++ b/test/files/run/t5230.check @@ -0,0 +1 @@ +evaluated = 2 diff --git a/test/files/run/t5230.scala b/test/files/run/t5230.scala new file mode 100644 index 000000000..5aab8f929 --- /dev/null +++ b/test/files/run/t5230.scala @@ -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) +}