summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-06-05 13:09:51 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-06-05 13:09:51 +0200
commitdd5fa60c1d56587b07548c01ea70a0077a9f1fa3 (patch)
treef2997b396fcc3850a4d97c3d332e8f85f0886b30 /test/files/run
parent1472dadd03496aa89624c81ded01edeb71420cc3 (diff)
downloadscala-dd5fa60c1d56587b07548c01ea70a0077a9f1fa3.tar.gz
scala-dd5fa60c1d56587b07548c01ea70a0077a9f1fa3.tar.bz2
scala-dd5fa60c1d56587b07548c01ea70a0077a9f1fa3.zip
SI-7558 Fix capture of free local vars in toolbox compiler
It was creating an `ObjectRef[<notype>]` because of a small bug in `capturedVariableType`.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t7558.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/files/run/t7558.scala b/test/files/run/t7558.scala
new file mode 100644
index 0000000000..bfcaaba5cc
--- /dev/null
+++ b/test/files/run/t7558.scala
@@ -0,0 +1,9 @@
+object Test extends App {
+ val cm = reflect.runtime.currentMirror
+ val u = cm.universe
+ import scala.tools.reflect.ToolBox
+ val tb = cm.mkToolBox()
+ val t = { var x = "ab".toList; u.reify { x = x.reverse; x }.tree }
+ val evaluated = tb.eval(t)
+ assert(evaluated == "ba".toList, evaluated)
+}