diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-02-24 16:37:03 +0100 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-02-24 16:37:03 +0100 |
commit | 7c709e122f7471353749525cff15602783fb348c (patch) | |
tree | 3568d312ba462cb0b61992cd7d657dc829b48843 /test/files | |
parent | 718a8974f4de14e52006ff152a0f4679fe5318c9 (diff) | |
parent | 7def1a90a01f5ac1e6e4e6b0c0cd58f131874a2f (diff) | |
download | scala-7c709e122f7471353749525cff15602783fb348c.tar.gz scala-7c709e122f7471353749525cff15602783fb348c.tar.bz2 scala-7c709e122f7471353749525cff15602783fb348c.zip |
Merge pull request #3580 from gkossakowski/issue/SI-8330
SI-8330: Mismatch in stack heights
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t8233-bcode.scala | 15 | ||||
-rw-r--r-- | test/files/run/t8233.scala | 15 |
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 } } |