summaryrefslogtreecommitdiff
path: root/test/files/run/t6199-toolbox.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-08-06 21:53:42 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-08-06 23:18:49 +0200
commitcac52ac3e3bd34dfc6540968c30d3e861799f9e4 (patch)
tree241dc7cc3cdaebd1c70fda523e336d76e5794679 /test/files/run/t6199-toolbox.scala
parent7bcb9da47362ba862a695f7c82c0095a8205e3e2 (diff)
downloadscala-cac52ac3e3bd34dfc6540968c30d3e861799f9e4.tar.gz
scala-cac52ac3e3bd34dfc6540968c30d3e861799f9e4.tar.bz2
scala-cac52ac3e3bd34dfc6540968c30d3e861799f9e4.zip
SI-6199 unit-returning methods now return unit
Since Scala reflection relies on Java reflection to perform member invocations, it inherits some of the quirks of the underlying platform. One of such quirks is returning null when invoking a void-returning method. This is now fixed by introducing a check after calling invoke.
Diffstat (limited to 'test/files/run/t6199-toolbox.scala')
-rw-r--r--test/files/run/t6199-toolbox.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/files/run/t6199-toolbox.scala b/test/files/run/t6199-toolbox.scala
new file mode 100644
index 0000000000..14670f8e21
--- /dev/null
+++ b/test/files/run/t6199-toolbox.scala
@@ -0,0 +1,8 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.ToolBox
+
+object Test extends App {
+ val tb = cm.mkToolBox()
+ println(tb.runExpr(Literal(Constant(()))))
+} \ No newline at end of file