aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/pos/list-optim-check.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pending/pos/list-optim-check.scala')
-rw-r--r--tests/pending/pos/list-optim-check.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/pending/pos/list-optim-check.scala b/tests/pending/pos/list-optim-check.scala
new file mode 100644
index 000000000..f6e6ddec7
--- /dev/null
+++ b/tests/pending/pos/list-optim-check.scala
@@ -0,0 +1,21 @@
+// Tests a map known to crash in optimizer with faster List map in SI-8240.
+// Equivalent tests for collect and flatmap do not crash, but are provided
+// anyway.
+// See ticket SI-8334 for optimizer bug.
+// TODO - Remove this test once SI-8334 is fixed and has its own test.
+class A {
+ def f: Boolean = {
+ val xs = Nil map (_ => return false)
+ true
+ }
+
+ def g: Boolean = {
+ val xs = Nil collect { case _ => return false }
+ true
+ }
+
+ def h: Boolean = {
+ val xs = Nil flatMap { _ => return false }
+ true
+ }
+}