summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2009-11-10 16:39:14 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2009-11-10 16:39:14 +0000
commite597ad04c072dac7300cec06e9f8bbf4d6d66855 (patch)
tree9dbe4c6425bf8ab5e731606998ca930372873d3d /test
parentf3a375b0e88508f7c8eb6cf6c47e0fb29e13d49a (diff)
downloadscala-e597ad04c072dac7300cec06e9f8bbf4d6d66855.tar.gz
scala-e597ad04c072dac7300cec06e9f8bbf4d6d66855.tar.bz2
scala-e597ad04c072dac7300cec06e9f8bbf4d6d66855.zip
added CanBuild type alias in package object sca...
added CanBuild type alias in package object scala.collection.generic added breakout to scala.collection test for breakout
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/collectGenericCC.scala2
-rw-r--r--test/files/run/breakout.check1
-rw-r--r--test/files/run/breakout.scala9
3 files changed, 11 insertions, 1 deletions
diff --git a/test/files/pos/collectGenericCC.scala b/test/files/pos/collectGenericCC.scala
index 9840f1071d..099a53d3f5 100644
--- a/test/files/pos/collectGenericCC.scala
+++ b/test/files/pos/collectGenericCC.scala
@@ -2,7 +2,7 @@ import scala.collection.generic._
import scala.collection._
object Test {
- def collect[A, Res](r: Traversable[A])(implicit bf: CanBuildFrom[Nothing, A, Res]) = {
+ def collect[A, Res](r: Traversable[A])(implicit bf: CanBuild[A, Res]) = {
val b = bf()
for (a <- r) b += a
b.result
diff --git a/test/files/run/breakout.check b/test/files/run/breakout.check
new file mode 100644
index 0000000000..7971496d1f
--- /dev/null
+++ b/test/files/run/breakout.check
@@ -0,0 +1 @@
+2, 3, 4
diff --git a/test/files/run/breakout.scala b/test/files/run/breakout.scala
new file mode 100644
index 0000000000..01ea08846e
--- /dev/null
+++ b/test/files/run/breakout.scala
@@ -0,0 +1,9 @@
+import scala.collection.generic._
+import scala.collection._
+import scala.collection.mutable._
+
+object Test extends Application {
+ val l = List(1, 2, 3)
+ val a: Array[Int] = l.map(_ + 1)(breakOut)
+ println(a.mkString(", "))
+} \ No newline at end of file