From 5ebbfdb144ab58a63cfb34266a1b45bb8468f80a Mon Sep 17 00:00:00 2001 From: Aleksandar Prokopec Date: Fri, 4 May 2012 14:11:56 +0200 Subject: Fix for si-5577. --- test/files/run/t5577.check | 11 +++++++++++ test/files/run/t5577.scala | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 test/files/run/t5577.check create mode 100644 test/files/run/t5577.scala (limited to 'test/files/run') 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) + } + +} -- cgit v1.2.3