summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTiark Rompf <tiark.rompf@epfl.ch>2012-02-19 23:52:57 +0100
committerPaul Phillips <paulp@improving.org>2012-02-21 20:41:44 -0800
commit2e66a13e266abeffcb0ad625901b2b15c3d80f25 (patch)
treecf8d6c3658974d475209a41476b4455387a1e23a /test
parent0b9a0e0d09f0769f4e95e2473821f941525f5702 (diff)
downloadscala-2e66a13e266abeffcb0ad625901b2b15c3d80f25.tar.gz
scala-2e66a13e266abeffcb0ad625901b2b15c3d80f25.tar.bz2
scala-2e66a13e266abeffcb0ad625901b2b15c3d80f25.zip
fixes SI-5506. better cps type propagation for polymorphic and multi-argument list methods.
Conflicts: src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
Diffstat (limited to 'test')
-rw-r--r--test/files/continuations-run/t5506.check7
-rw-r--r--test/files/continuations-run/t5506.scala58
2 files changed, 65 insertions, 0 deletions
diff --git a/test/files/continuations-run/t5506.check b/test/files/continuations-run/t5506.check
new file mode 100644
index 0000000000..38b76c63f1
--- /dev/null
+++ b/test/files/continuations-run/t5506.check
@@ -0,0 +1,7 @@
+List(1, 2, 3)
+List(1, 2, 3)
+List(1, 2, 3)
+List(1, 2, 3)
+List(1, 2, 3)
+List(1, 2, 3)
+List(1, 2, 3)
diff --git a/test/files/continuations-run/t5506.scala b/test/files/continuations-run/t5506.scala
new file mode 100644
index 0000000000..2b5c1118f7
--- /dev/null
+++ b/test/files/continuations-run/t5506.scala
@@ -0,0 +1,58 @@
+import scala.util.continuations._
+
+object Test {
+
+def g: List[Int] @suspendable = List(1,2,3)
+
+def fp10: List[Int] @suspendable = {
+g.map(x => x)
+}
+
+def fp11: List[Int] @suspendable = {
+val z = g.map(x => x)
+z
+}
+
+
+def fp12: List[Int] @suspendable = {
+val z = List(1,2,3)
+z.map(x => x)
+}
+
+
+
+def fp20: List[Int] @suspendable = {
+g.map[Int,List[Int]](x => x)
+}
+
+
+def fp21: List[Int] @suspendable = {
+val z = g.map[Int,List[Int]](x => x)
+z
+}
+
+def fp22: List[Int] @suspendable = {
+val z = g.map[Int,List[Int]](x => x)(List.canBuildFrom[Int])
+z
+}
+
+def fp23: List[Int] @suspendable = {
+val z = g.map(x => x)(List.canBuildFrom[Int])
+z
+}
+
+
+def main(args: Array[String]) = {
+ reset {
+ println(fp10)
+ println(fp11)
+ println(fp12)
+
+ println(fp20)
+ println(fp21)
+ println(fp22)
+ println(fp23)
+ }
+}
+
+}