diff options
Diffstat (limited to 'test/files/run/bug3984.scala')
-rw-r--r-- | test/files/run/bug3984.scala | 21 |
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) + } +} |