Reproduction steps
Scala version: 3.7.0 (but the bug is in the standard library)
scala> import scala.collection.immutable.ArraySeq
scala> ArraySeq(0.0f) == ArraySeq(-0.0f)
val res0: Boolean = false
scala> ArraySeq(0.0f).map(identity) == ArraySeq(-0.0f)
val res1: Boolean = true
Problem
ArraySeq equals should use == for floating point that follow IEEE semantics as done by Other Seqs.
The problem is that the specialization ofFloat and ofDouble delegate equals to java.util.Arrays.equals but that is documented to not follow the normal == behavior https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html#equals-double:A-double:A-
Reproduction steps
Scala version: 3.7.0 (but the bug is in the standard library)
Problem
ArraySeq equals should use
==for floating point that follow IEEE semantics as done by Other Seqs.The problem is that the specialization ofFloat and ofDouble delegate equals to
java.util.Arrays.equalsbut that is documented to not follow the normal==behavior https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html#equals-double:A-double:A-