summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/pos/t6157.flags1
-rw-r--r--test/files/pos/t6157.scala25
-rw-r--r--test/files/run/private-inline.scala2
-rw-r--r--test/files/run/t6188.check1
-rw-r--r--test/files/run/t6188.flags1
-rw-r--r--test/files/run/t6188.scala12
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)
+ }
+}
+