diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-11 11:00:32 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-11 11:00:32 -0700 |
commit | b2d22e10422a2017cd1b4345eb45112c519c0d9f (patch) | |
tree | c67d35fdd7004a38d038047efa431a40ba204697 /test | |
parent | 228fb309a18d080dbcb2e51c1bbdf74da60865f9 (diff) | |
parent | 93d3cc703806bec34c4ef0c7817239966363c193 (diff) | |
download | scala-b2d22e10422a2017cd1b4345eb45112c519c0d9f.tar.gz scala-b2d22e10422a2017cd1b4345eb45112c519c0d9f.tar.bz2 scala-b2d22e10422a2017cd1b4345eb45112c519c0d9f.zip |
Merge pull request #1262 from jsuereth/fix/SI-6271
Fixes SI-6271 - Missing isEmpty override for views.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t6271.scala | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/files/run/t6271.scala b/test/files/run/t6271.scala new file mode 100644 index 0000000000..8ebf7ad8b5 --- /dev/null +++ b/test/files/run/t6271.scala @@ -0,0 +1,32 @@ +object Test extends App { + def filterIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x filter (_ > 0) ) } + filtered.iterator.toIterable.flatten + } + def takenIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x take 0 ) } + filtered.iterator.toIterable.flatten + } + def droppedIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x drop 1 ) } + filtered.iterator.toIterable.flatten + } + def flatMappedIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x flatMap (_ => List()) ) } + filtered.iterator.toIterable.flatten + } + def slicedIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x slice (2,3) ) } + filtered.iterator.toIterable.flatten + } + filterIssue + takenIssue + droppedIssue + flatMappedIssue + slicedIssue +} |