diff options
Diffstat (limited to 'test/files')
-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) + } + +} |