summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-05 09:51:20 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-05 09:51:20 -0800
commitfd4178680643aa064d5a6f7b8e668f79e0be5cd4 (patch)
treeac7798e9b3e60d09140039fee439630beab983dd /test
parent01770aa7ff1d5b89a6b67a964a818320c8c9d15e (diff)
parent9506d5273b4b10037c202f01e8556076998bd064 (diff)
downloadscala-fd4178680643aa064d5a6f7b8e668f79e0be5cd4.tar.gz
scala-fd4178680643aa064d5a6f7b8e668f79e0be5cd4.tar.bz2
scala-fd4178680643aa064d5a6f7b8e668f79e0be5cd4.zip
Merge pull request #3462 from retronym/ticket/8233
SI-8233 Fix regression in backend with boxed nulls
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t8233-bcode.flags1
-rw-r--r--test/files/run/t8233-bcode.scala18
-rw-r--r--test/files/run/t8233.scala18
3 files changed, 37 insertions, 0 deletions
diff --git a/test/files/run/t8233-bcode.flags b/test/files/run/t8233-bcode.flags
new file mode 100644
index 0000000000..c30091d3de
--- /dev/null
+++ b/test/files/run/t8233-bcode.flags
@@ -0,0 +1 @@
+-Ybackend:GenBCode
diff --git a/test/files/run/t8233-bcode.scala b/test/files/run/t8233-bcode.scala
new file mode 100644
index 0000000000..fae1c2b702
--- /dev/null
+++ b/test/files/run/t8233-bcode.scala
@@ -0,0 +1,18 @@
+object Test {
+ def bar(s: String) = s;
+ val o: Option[Null] = None
+ def nullReference {
+ val a: Null = o.get
+ bar(a) // Was: VerifyError under GenICode
+ }
+
+ def literal {
+ val a: Null = null
+ bar(a)
+ }
+
+ def main(args: Array[String]) = {
+ try { nullReference } catch { case _: NoSuchElementException => }
+ literal
+ }
+}
diff --git a/test/files/run/t8233.scala b/test/files/run/t8233.scala
new file mode 100644
index 0000000000..fae1c2b702
--- /dev/null
+++ b/test/files/run/t8233.scala
@@ -0,0 +1,18 @@
+object Test {
+ def bar(s: String) = s;
+ val o: Option[Null] = None
+ def nullReference {
+ val a: Null = o.get
+ bar(a) // Was: VerifyError under GenICode
+ }
+
+ def literal {
+ val a: Null = null
+ bar(a)
+ }
+
+ def main(args: Array[String]) = {
+ try { nullReference } catch { case _: NoSuchElementException => }
+ literal
+ }
+}