summaryrefslogtreecommitdiff
path: root/test/files/run/bug3984.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-09 03:12:57 +0000
committerPaul Phillips <paulp@improving.org>2010-11-09 03:12:57 +0000
commit6cb5c25802ec68d31fccde6bf9ee2fd2e8e3ff45 (patch)
tree250b1a0c981f7118cf51684d81b61a80f576717b /test/files/run/bug3984.scala
parent107cf1ae8e934b0ef7a6b6e819193b2166f3c44b (diff)
downloadscala-6cb5c25802ec68d31fccde6bf9ee2fd2e8e3ff45.tar.gz
scala-6cb5c25802ec68d31fccde6bf9ee2fd2e8e3ff45.tar.bz2
scala-6cb5c25802ec68d31fccde6bf9ee2fd2e8e3ff45.zip
Iteration bug in TrieIterator.
Diffstat (limited to 'test/files/run/bug3984.scala')
-rw-r--r--test/files/run/bug3984.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/bug3984.scala b/test/files/run/bug3984.scala
new file mode 100644
index 0000000000..3e4d2edf53
--- /dev/null
+++ b/test/files/run/bug3984.scala
@@ -0,0 +1,21 @@
+object Test {
+ import scala.collection.immutable.{ Set => ImmutSet }
+ import scala.collection.mutable.{ Set => MutSet }
+
+ case class IH (i: Int, h: Int) {
+ override def hashCode: Int = h
+ }
+
+ def main (args: Array[String]) {
+ var is = ImmutSet.empty[IH]
+ var ms = MutSet.empty[IH]
+ for (ih <- List(IH(2,0),IH(0,0),IH(4,4),IH(6,4),IH(-8,1520786080))) {
+ is = is + ih
+ ms = ms + ih
+ }
+ val x = IH(6,4)
+ is = is - x
+ ms = ms - x
+ assert(is == ms)
+ }
+}