From 440d28d027f2a1910ec6c4c09ad02602b67c7ea9 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Tue, 18 Sep 2012 01:08:33 +0200 Subject: SI-5943 toolboxes now autoimport Predef and scala Previously tb.typeCheck used default typer, which builds upon NoContext. Changing the context to analyzer.rootContext(NoCompilationUnit, EmptyTree) fixed the missing imports problem. Unfortunately this doesn't help in cases like "math.sqrt(4.0)" because of https://issues.scala-lang.org/browse/SI-6393. But anyways I'm adding this test case to pending. --- test/files/run/t5943a2.scala | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/files/run/t5943a2.scala (limited to 'test/files/run/t5943a2.scala') diff --git a/test/files/run/t5943a2.scala b/test/files/run/t5943a2.scala new file mode 100644 index 0000000000..fda800852d --- /dev/null +++ b/test/files/run/t5943a2.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends App { + val tb = cm.mkToolBox() + val expr = tb.parse("1 to 3 map (_+1)") + println(tb.eval(expr)) +} \ No newline at end of file -- cgit v1.2.3