summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/collection/mutable/UnrolledBuffer.scala2
-rw-r--r--test/files/run/t5867.check1
-rw-r--r--test/files/run/t5867.scala14
3 files changed, 17 insertions, 0 deletions
diff --git a/src/library/scala/collection/mutable/UnrolledBuffer.scala b/src/library/scala/collection/mutable/UnrolledBuffer.scala
index cd76c7de4e..0c2e6e1cae 100644
--- a/src/library/scala/collection/mutable/UnrolledBuffer.scala
+++ b/src/library/scala/collection/mutable/UnrolledBuffer.scala
@@ -179,6 +179,8 @@ extends collection.mutable.AbstractBuffer[T]
}
}
+ override def clone(): UnrolledBuffer[T] = new UnrolledBuffer[T] ++= this
+
override def stringPrefix = "UnrolledBuffer"
}
diff --git a/test/files/run/t5867.check b/test/files/run/t5867.check
new file mode 100644
index 0000000000..e1811eeefa
--- /dev/null
+++ b/test/files/run/t5867.check
@@ -0,0 +1 @@
+UnrolledBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50) \ No newline at end of file
diff --git a/test/files/run/t5867.scala b/test/files/run/t5867.scala
new file mode 100644
index 0000000000..6a86ac3e6d
--- /dev/null
+++ b/test/files/run/t5867.scala
@@ -0,0 +1,14 @@
+import collection.mutable.UnrolledBuffer
+
+
+
+object Test {
+
+ def main(args: Array[String]) {
+ val buf = UnrolledBuffer(1 to 50: _*)
+ val dub = buf ++ buf
+
+ println(dub)
+ }
+
+}