summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/collectGenericCC.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/pos/collectGenericCC.scala b/test/files/pos/collectGenericCC.scala
new file mode 100644
index 0000000000..2873029bb6
--- /dev/null
+++ b/test/files/pos/collectGenericCC.scala
@@ -0,0 +1,14 @@
+import scala.collection.generic._
+import scala.collection._
+
+object Test {
+ def collect[A, Res](r: {def foreach[U](k: A => U): Unit})(implicit bf: BuilderFactory[A, Res, Nothing]) = {
+ val b = bf()
+ for (a <- r) b += a
+ b.result
+ }
+
+ collect[Int, Vector[Int]](List(1,2,3,4))
+ collect[Char, String](List('1','2','3','4'))
+ collect[Char, Array[Char]](List('1','2','3','4'))
+} \ No newline at end of file