summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-10-14 16:12:03 +0000
committerPaul Phillips <paulp@improving.org>2010-10-14 16:12:03 +0000
commit920449d6eeb0267f96b115a47866ccd53a5a3c55 (patch)
tree5539dddab7fd19e928a7a86a149224b569ec431d
parent6893c72ee1a55e85409f12366b83c217dcbc0ea6 (diff)
downloadscala-920449d6eeb0267f96b115a47866ccd53a5a3c55.tar.gz
scala-920449d6eeb0267f96b115a47866ccd53a5a3c55.tar.bz2
scala-920449d6eeb0267f96b115a47866ccd53a5a3c55.zip
All this time with Nil only claiming to be equa...
All this time with Nil only claiming to be equal to immutable.Seqs, how is it possible? Closes #3923, no review.
-rw-r--r--src/library/scala/collection/immutable/List.scala2
-rw-r--r--test/files/run/bug3923.scala8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala
index 93c3134fd7..8c018912c2 100644
--- a/src/library/scala/collection/immutable/List.scala
+++ b/src/library/scala/collection/immutable/List.scala
@@ -391,7 +391,7 @@ case object Nil extends List[Nothing] {
throw new UnsupportedOperationException("tail of empty list")
// Removal of equals method here might lead to an infinite recursion similar to IntMap.equals.
override def equals(that: Any) = that match {
- case that1: Seq[_] => that1.isEmpty
+ case that1: collection.Seq[_] => that1.isEmpty
case _ => false
}
}
diff --git a/test/files/run/bug3923.scala b/test/files/run/bug3923.scala
new file mode 100644
index 0000000000..484095a607
--- /dev/null
+++ b/test/files/run/bug3923.scala
@@ -0,0 +1,8 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ assert(collection.mutable.ArraySeq() == Nil)
+ assert(collection.mutable.ArraySeq() == Seq())
+ assert(Seq() == collection.mutable.ArraySeq())
+ assert(Nil == collection.mutable.ArraySeq())
+ }
+}