summaryrefslogtreecommitdiff
path: root/test/files/run/t5943a2.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-18 01:08:33 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-20 12:10:46 +0200
commit440d28d027f2a1910ec6c4c09ad02602b67c7ea9 (patch)
tree95651abb4a895636fb68d68507ff11641218119d /test/files/run/t5943a2.scala
parent66603a2c003852d39faec20a9763fb0e25049cf4 (diff)
downloadscala-440d28d027f2a1910ec6c4c09ad02602b67c7ea9.tar.gz
scala-440d28d027f2a1910ec6c4c09ad02602b67c7ea9.tar.bz2
scala-440d28d027f2a1910ec6c4c09ad02602b67c7ea9.zip
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.
Diffstat (limited to 'test/files/run/t5943a2.scala')
-rw-r--r--test/files/run/t5943a2.scala9
1 files changed, 9 insertions, 0 deletions
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