summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t8233-bcode.scala15
-rw-r--r--test/files/run/t8233.scala15
2 files changed, 28 insertions, 2 deletions
diff --git a/test/files/run/t8233-bcode.scala b/test/files/run/t8233-bcode.scala
index fae1c2b702..72d013e553 100644
--- a/test/files/run/t8233-bcode.scala
+++ b/test/files/run/t8233-bcode.scala
@@ -11,8 +11,21 @@ object Test {
bar(a)
}
- def main(args: Array[String]) = {
+ /** Check SI-8330 for details */
+ def expectedUnitInABranch(b: Boolean): Boolean = {
+ if (b) {
+ val x = 12
+ ()
+ } else {
+ // here expected type is (unboxed) Unit
+ null
+ }
+ true
+ }
+
+ def main(args: Array[String]): Unit = {
try { nullReference } catch { case _: NoSuchElementException => }
literal
+ expectedUnitInABranch(true)
}
}
diff --git a/test/files/run/t8233.scala b/test/files/run/t8233.scala
index fae1c2b702..97a98a2e21 100644
--- a/test/files/run/t8233.scala
+++ b/test/files/run/t8233.scala
@@ -11,8 +11,21 @@ object Test {
bar(a)
}
- def main(args: Array[String]) = {
+ /** Check SI-8330 for details */
+ def expectedUnitInABranch(b: Boolean): Boolean = {
+ if (b) {
+ val x = 12
+ ()
+ } else {
+ // here expected type is (unboxed) Unit
+ null
+ }
+ true
+ }
+
+ def main(args: Array[String]): Unit = {
try { nullReference } catch { case _: NoSuchElementException => }
literal
+ expectedUnitInABranch(true) // Was: VerifyError under GenICode
}
}