From e597ad04c072dac7300cec06e9f8bbf4d6d66855 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 10 Nov 2009 16:39:14 +0000 Subject: 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 --- test/files/pos/collectGenericCC.scala | 2 +- test/files/run/breakout.check | 1 + test/files/run/breakout.scala | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/files/run/breakout.check create mode 100644 test/files/run/breakout.scala (limited to 'test') 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 -- cgit v1.2.3