From 61cc8ff61c81a1276a921ad5288ee3bebea1c96e Mon Sep 17 00:00:00 2001 From: Miguel Garcia Date: Mon, 6 Aug 2012 11:01:17 +0200 Subject: SI-6188 ICodeReader notes exception handlers, Inliner takes them into account --- test/files/run/t6188.check | 1 + test/files/run/t6188.flags | 1 + test/files/run/t6188.scala | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 test/files/run/t6188.check create mode 100644 test/files/run/t6188.flags create mode 100644 test/files/run/t6188.scala (limited to 'test') 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) + } +} + -- cgit v1.2.3