diff options
author | Paul Phillips <paulp@improving.org> | 2011-05-28 23:28:11 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-05-28 23:28:11 +0000 |
commit | 3adaa37cd2fc40deeb58ce9da9015f329d9c254e (patch) | |
tree | 3ce10b5e509c4239d197a7b3123d9b59df6d1f8f /test | |
parent | d76dc724e319663b6f854ecade8524323a576ea8 (diff) | |
download | scala-3adaa37cd2fc40deeb58ce9da9015f329d9c254e.tar.gz scala-3adaa37cd2fc40deeb58ce9da9015f329d9c254e.tar.bz2 scala-3adaa37cd2fc40deeb58ce9da9015f329d9c254e.zip |
Yikes, prependToList was violating List immutab...
Yikes, prependToList was violating List immutability. Closes #4656, no
review.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/bug4656.check | 1 | ||||
-rw-r--r-- | test/files/run/bug4656.scala | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/bug4656.check b/test/files/run/bug4656.check new file mode 100644 index 0000000000..15a62794a9 --- /dev/null +++ b/test/files/run/bug4656.check @@ -0,0 +1 @@ +List(1, 2, 3) diff --git a/test/files/run/bug4656.scala b/test/files/run/bug4656.scala new file mode 100644 index 0000000000..4f3d189c8f --- /dev/null +++ b/test/files/run/bug4656.scala @@ -0,0 +1,13 @@ +object Test { + def f = { + val buf = new collection.mutable.ListBuffer[Int] + buf ++= List(1, 2, 3) + val l = buf.toList + buf prependToList List(4, 5, 6) + l + } + + def main(args: Array[String]): Unit = { + println(f) + } +} |