summaryrefslogtreecommitdiff
path: root/test/files/run/function-null-unbox.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/function-null-unbox.scala')
-rw-r--r--test/files/run/function-null-unbox.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/files/run/function-null-unbox.scala b/test/files/run/function-null-unbox.scala
new file mode 100644
index 0000000000..6c0369fffd
--- /dev/null
+++ b/test/files/run/function-null-unbox.scala
@@ -0,0 +1,8 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ val i2s = (x: Int) => ""
+ assert(i2s.asInstanceOf[AnyRef => String].apply(null) == "")
+ val i2i = (x: Int) => x + 1
+ assert(i2i.asInstanceOf[AnyRef => Int].apply(null) == 1)
+ }
+}