summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-14 10:46:05 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-14 10:46:05 -0800
commit35eb20283e7da0af28aaa0ae0d1051e21cc6c25d (patch)
treec69800ef0667e19b2cf158a02a75aa2d5974d0f5 /test/files
parent7eca4e724cde06fd9914eac975ff5c4136704bce (diff)
parent509bd09a994365065550bcac4c821b15b8c6dbf0 (diff)
downloadscala-35eb20283e7da0af28aaa0ae0d1051e21cc6c25d.tar.gz
scala-35eb20283e7da0af28aaa0ae0d1051e21cc6c25d.tar.bz2
scala-35eb20283e7da0af28aaa0ae0d1051e21cc6c25d.zip
Merge pull request #3376 from Ichoran/issue/8153
SI-8153 Mutation is hard, let's go shopping with an empty list
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/t8153.check1
-rw-r--r--test/files/run/t8153.scala14
2 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/t8153.check b/test/files/run/t8153.check
new file mode 100644
index 0000000000..0cfbf08886
--- /dev/null
+++ b/test/files/run/t8153.check
@@ -0,0 +1 @@
+2
diff --git a/test/files/run/t8153.scala b/test/files/run/t8153.scala
new file mode 100644
index 0000000000..f9b223f974
--- /dev/null
+++ b/test/files/run/t8153.scala
@@ -0,0 +1,14 @@
+object Test {
+ def f() = {
+ val lb = scala.collection.mutable.ListBuffer[Int](1, 2)
+ val it = lb.iterator
+ if (it.hasNext) it.next
+ val xs = lb.toList
+ lb += 3
+ it.mkString
+ }
+
+ def main(args: Array[String]) {
+ println(f())
+ }
+}