From dd5fa60c1d56587b07548c01ea70a0077a9f1fa3 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 5 Jun 2013 13:09:51 +0200 Subject: SI-7558 Fix capture of free local vars in toolbox compiler It was creating an `ObjectRef[]` because of a small bug in `capturedVariableType`. --- test/files/run/t7558.scala | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/files/run/t7558.scala (limited to 'test/files/run') 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) +} -- cgit v1.2.3