diff options
author | Josh Suereth <joshua.suereth@gmail.com> | 2012-05-08 21:53:25 -0400 |
---|---|---|
committer | Josh Suereth <joshua.suereth@gmail.com> | 2012-05-08 21:53:25 -0400 |
commit | 84764949e299329e476824c96fb250f72506bacd (patch) | |
tree | 86c9365cf1a95ad293e87ef5c731e169238ba477 /test | |
parent | da04d691c455aa3f3391bdbd9bac7fb59f29cedf (diff) | |
download | scala-84764949e299329e476824c96fb250f72506bacd.tar.gz scala-84764949e299329e476824c96fb250f72506bacd.tar.bz2 scala-84764949e299329e476824c96fb250f72506bacd.zip |
Fixes SI-5328. Iterator.patched failed when from=0.
It turns out iterator.patched forgot to drop replacement values if they were at the beginning.
This is because the index was advancing before checking to see if replaced elements should be
dropped. Moved this behavior to the beginning of next.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t5328.check | 3 | ||||
-rw-r--r-- | test/files/run/t5328.scala | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/files/run/t5328.check b/test/files/run/t5328.check new file mode 100644 index 0000000000..77a43968c5 --- /dev/null +++ b/test/files/run/t5328.check @@ -0,0 +1,3 @@ +2 +1,2,8 +1,8,3 diff --git a/test/files/run/t5328.scala b/test/files/run/t5328.scala new file mode 100644 index 0000000000..12adf45b84 --- /dev/null +++ b/test/files/run/t5328.scala @@ -0,0 +1,5 @@ +object Test extends App { + println(Vector(1).view.updated(0,2).toList mkString ",") + println(Seq(1,2,3).view.updated(2,8).toList mkString ",") + println(List(1,2,3).view.updated(1,8).toList mkString ",") +} |