diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-06 13:31:32 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-06 13:31:32 -0700 |
commit | f5b9ef4cd76d2c6ebf311bcee573fd43fc880326 (patch) | |
tree | 7bfe26021baaa7ad7e0765fff298c82e0c13798e /test/files | |
parent | b531f9577f5be47f99b0be0d6b9d586668e9ae69 (diff) | |
parent | 17037367049312eb3d26766a5759295ac9f8aed6 (diff) | |
download | scala-f5b9ef4cd76d2c6ebf311bcee573fd43fc880326.tar.gz scala-f5b9ef4cd76d2c6ebf311bcee573fd43fc880326.tar.bz2 scala-f5b9ef4cd76d2c6ebf311bcee573fd43fc880326.zip |
Merge pull request #1059 from magarciaEPFL/ticket-SI-6188
SI-6188
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t6157.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t6157.scala | 25 | ||||
-rw-r--r-- | test/files/run/private-inline.scala | 2 | ||||
-rw-r--r-- | test/files/run/t6188.check | 1 | ||||
-rw-r--r-- | test/files/run/t6188.flags | 1 | ||||
-rw-r--r-- | test/files/run/t6188.scala | 12 |
6 files changed, 41 insertions, 1 deletions
diff --git a/test/files/pos/t6157.flags b/test/files/pos/t6157.flags new file mode 100644 index 0000000000..0ebca3e7af --- /dev/null +++ b/test/files/pos/t6157.flags @@ -0,0 +1 @@ + -optimize diff --git a/test/files/pos/t6157.scala b/test/files/pos/t6157.scala new file mode 100644 index 0000000000..7463989b14 --- /dev/null +++ b/test/files/pos/t6157.scala @@ -0,0 +1,25 @@ +// SI-6157 - Compiler crash on inlined function and -optimize option + +object Test { + def main(args: Array[String]) { + Console.println( + ErrorHandler.defaultIfIOException("String")("String") + ) + } +} + +import java.io.IOException + +object ErrorHandler { + + @inline + def defaultIfIOException[T](default: => T)(closure: => T): T = { + try { + closure + } catch { + case e: IOException => + default + } + } +} + diff --git a/test/files/run/private-inline.scala b/test/files/run/private-inline.scala index a45300b026..a62007779c 100644 --- a/test/files/run/private-inline.scala +++ b/test/files/run/private-inline.scala @@ -30,7 +30,7 @@ final class A { } object Test { - def methodClasses = List("f1a", "f1b", "f2a", "f2b") map ("A$$anonfun$" + _ + "$1") + def methodClasses = List("f1a", "f2a") map ("A$$anonfun$" + _ + "$1") def main(args: Array[String]): Unit = { val a = new A diff --git a/test/files/run/t6188.check b/test/files/run/t6188.check new file mode 100644 index 0000000000..1af3932ecd --- /dev/null +++ b/test/files/run/t6188.check @@ -0,0 +1 @@ +Failure(java.lang.Exception: this is an exception)
diff --git a/test/files/run/t6188.flags b/test/files/run/t6188.flags new file mode 100644 index 0000000000..0ebca3e7af --- /dev/null +++ b/test/files/run/t6188.flags @@ -0,0 +1 @@ + -optimize diff --git a/test/files/run/t6188.scala b/test/files/run/t6188.scala new file mode 100644 index 0000000000..48180ddf9d --- /dev/null +++ b/test/files/run/t6188.scala @@ -0,0 +1,12 @@ +// SI-6188 Optimizer incorrectly removes method invocations containing throw expressions + +import scala.util.Success + +object Test { + def main(args: Array[String]) { + val e = new Exception("this is an exception") + val res = Success(1).flatMap[Int](x => throw e) + println(res) + } +} + |