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/pos | |
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/pos')
-rw-r--r-- | test/files/pos/t6157.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t6157.scala | 25 |
2 files changed, 26 insertions, 0 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 + } + } +} + |