diff options
-rw-r--r-- | src/library/scala/collection/immutable/Stream.scala | 15 | ||||
-rw-r--r-- | test/files/run/t2177.check | 1 | ||||
-rw-r--r-- | test/files/run/t2177.scala | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala index a00803797f..00bc959fe4 100644 --- a/src/library/scala/collection/immutable/Stream.scala +++ b/src/library/scala/collection/immutable/Stream.scala @@ -222,6 +222,21 @@ self => b } + override def mkString(start: String, sep: String, end: String): String = { + this.force + super.mkString(start, sep, end) + } + + override def mkString(sep: String): String = { + this.force + super.mkString(sep) + } + + override def mkString: String = { + this.force + super.mkString + } + /** Returns the <code>n</code> first elements of this stream, or else the whole * stream, if it has less than <code>n</code> elements. * diff --git a/test/files/run/t2177.check b/test/files/run/t2177.check new file mode 100644 index 0000000000..e56e15bb7d --- /dev/null +++ b/test/files/run/t2177.check @@ -0,0 +1 @@ +12345 diff --git a/test/files/run/t2177.scala b/test/files/run/t2177.scala new file mode 100644 index 0000000000..fd1a29d198 --- /dev/null +++ b/test/files/run/t2177.scala @@ -0,0 +1,3 @@ +object Test extends Application { + println(Stream.from(1).take(5).mkString) +} |