summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/xml/Attribute.scala5
-rw-r--r--test/files/run/t3886.scala11
2 files changed, 13 insertions, 3 deletions
diff --git a/src/library/scala/xml/Attribute.scala b/src/library/scala/xml/Attribute.scala
index 17780fc024..2bb348c1ca 100644
--- a/src/library/scala/xml/Attribute.scala
+++ b/src/library/scala/xml/Attribute.scala
@@ -39,8 +39,7 @@ object Attribute {
}
}
-abstract trait Attribute extends MetaData
-{
+abstract trait Attribute extends MetaData {
def pre: String // will be null if unprefixed
val key: String
val value: Seq[Node]
@@ -70,7 +69,7 @@ abstract trait Attribute extends MetaData
case _ => false
}
override def strict_==(other: Equality) = other match {
- case x: Attribute => (pre == x.pre) && (key == x.key) && (value sameElements x.value)
+ case x: Attribute => (pre == x.pre) && (key == x.key) && (value sameElements x.value) && (next == x.next)
case _ => false
}
override def basisForHashCode = List(pre, key, value)
diff --git a/test/files/run/t3886.scala b/test/files/run/t3886.scala
new file mode 100644
index 0000000000..1e8e7ad252
--- /dev/null
+++ b/test/files/run/t3886.scala
@@ -0,0 +1,11 @@
+object Test {
+ def main(args: Array[String]) {
+ assert( <k a="1" b="2"/> == <k a="1" b="2"/> )
+ assert( <k a="1" b="2"/> != <k a="1" b="3"/> )
+ assert( <k a="1" b="2"/> != <k a="2" b="2"/> )
+
+ assert( <k a="1" b="2"/> != <k/> )
+ assert( <k a="1" b="2"/> != <k a="1"/> )
+ assert( <k a="1" b="2"/> != <k b="2"/> )
+ }
+}