summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorJosh Suereth <Joshua.Suereth@gmail.com>2012-07-30 17:36:50 -0700
committerJosh Suereth <Joshua.Suereth@gmail.com>2012-07-30 17:36:50 -0700
commitf4693871f4aad1fdbdbb743feaed8a848a9e2dca (patch)
tree3f813ed8c97beef93ec651d74fb945c598f1ec1a /test/files/run
parent123d14cf6a05f033762db6b57f2c56f20569d84c (diff)
parent5589eeeb9a5e09352544efc629013caf2d18a842 (diff)
downloadscala-f4693871f4aad1fdbdbb743feaed8a848a9e2dca.tar.gz
scala-f4693871f4aad1fdbdbb743feaed8a848a9e2dca.tar.bz2
scala-f4693871f4aad1fdbdbb743feaed8a848a9e2dca.zip
Merge pull request #1020 from odersky/ticket/5866
SI-5866 Support casting null to value classes
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t5866.check2
-rw-r--r--test/files/run/t5866.scala11
2 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/t5866.check b/test/files/run/t5866.check
new file mode 100644
index 0000000000..9f4ec729a7
--- /dev/null
+++ b/test/files/run/t5866.check
@@ -0,0 +1,2 @@
+0.0
+Foo(0.0)
diff --git a/test/files/run/t5866.scala b/test/files/run/t5866.scala
new file mode 100644
index 0000000000..120773effa
--- /dev/null
+++ b/test/files/run/t5866.scala
@@ -0,0 +1,11 @@
+class Foo(val d: Double) extends AnyVal {
+ override def toString = s"Foo($d)"
+}
+object Test {
+ def main(args: Array[String]): Unit = {
+ val d: Double = null.asInstanceOf[Double]
+ println(d)
+ val f: Foo = null.asInstanceOf[Foo]
+ println(f)
+ }
+}