diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-21 18:39:35 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-03-21 18:39:35 +0100 |
commit | 9b17c6c86f3150afa7b5b395c23ec3fdf9c14200 (patch) | |
tree | 61651354673a1fbbe2800d047e3dfd8211567af9 /tests/pos/collections.scala | |
parent | 5f318bc925c227d2bce5cff31610803185b57f54 (diff) | |
download | dotty-9b17c6c86f3150afa7b5b395c23ec3fdf9c14200.tar.gz dotty-9b17c6c86f3150afa7b5b395c23ec3fdf9c14200.tar.bz2 dotty-9b17c6c86f3150afa7b5b395c23ec3fdf9c14200.zip |
Fix of Fix of t1236: higher-kinded
Fix of d6df293d2120f2247198cb6646a23c338f7dcbbf. It turned out the original commit
was faulty in that iterator.flatten did not typecheck. The problem is fixed in this
commit and flatten is added to the collections test.
Diffstat (limited to 'tests/pos/collections.scala')
-rw-r--r-- | tests/pos/collections.scala | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/pos/collections.scala b/tests/pos/collections.scala index cd84f03d8..535e4b542 100644 --- a/tests/pos/collections.scala +++ b/tests/pos/collections.scala @@ -1,10 +1,10 @@ import scala.collection.generic.CanBuildFrom object collections { - + val arr = Array("a", "b") val aa = arr ++ arr - + List(1, 2, 3) map (x => 2) val s = Set(1, 2, 3) @@ -18,16 +18,19 @@ object collections { val ints3: List[Int] = ints2 val f = (x: Int) => x + 1 val ints4: List[Int] = List(1, 2, 3, 5) - + val ys = ints3 map (x => x + 1) val zs = ys filter (y => y != 0) - + val chrs = "abc" - + def do2(x: Int, y: Char) = () - + chrs foreach println - + (ints2, chrs).zipped foreach do2 -}
\ No newline at end of file + val xs = List(List(1), List(2), List(3)).iterator + println(xs.flatten) + +} |