diff options
author | Aleksandar Prokopec <axel22@gmail.com> | 2012-05-04 14:11:56 +0200 |
---|---|---|
committer | Aleksandar Prokopec <axel22@gmail.com> | 2012-05-04 14:11:56 +0200 |
commit | 5ebbfdb144ab58a63cfb34266a1b45bb8468f80a (patch) | |
tree | 48173cb1e8ec08b5ab6b8eef1ba6469d24bb43f5 /test/files/run | |
parent | f146d5826fc335ee1ca9c285d69086a7475cb71e (diff) | |
download | scala-5ebbfdb144ab58a63cfb34266a1b45bb8468f80a.tar.gz scala-5ebbfdb144ab58a63cfb34266a1b45bb8468f80a.tar.bz2 scala-5ebbfdb144ab58a63cfb34266a1b45bb8468f80a.zip |
Fix for si-5577.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t5577.check | 11 | ||||
-rw-r--r-- | test/files/run/t5577.scala | 27 |
2 files changed, 38 insertions, 0 deletions
diff --git a/test/files/run/t5577.check b/test/files/run/t5577.check new file mode 100644 index 0000000000..3eca387955 --- /dev/null +++ b/test/files/run/t5577.check @@ -0,0 +1,11 @@ +Received a size hint: 10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9
\ No newline at end of file diff --git a/test/files/run/t5577.scala b/test/files/run/t5577.scala new file mode 100644 index 0000000000..b5d6d8c5b6 --- /dev/null +++ b/test/files/run/t5577.scala @@ -0,0 +1,27 @@ + + + +import collection._ + + + +object Test { + + class AlarmingBuffer[T] extends mutable.ArrayBuffer[T] { + override def sizeHint(x: Int) { + println("Received a size hint: " + x) + super.sizeHint(x) + } + } + + def main(args: Array[String]) { + val iteratorBuilder = (new AlarmingBuffer[Int]) mapResult { + res => res.iterator + } + + iteratorBuilder.sizeHint(10) + iteratorBuilder ++= (0 until 10) + iteratorBuilder.result.foreach(println) + } + +} |