Skip to content

SeqView violated rules for java.lang.Object.equals #10201

@scabug

Description

@scabug

In JavaDoc for Object.equals

It is reflexive: for any non-null reference value x, x.equals\(x\) should return true.

However, SeqView does not conform the rule:

Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_102).
Type in expressions for evaluation. Or try :help.

scala> val v = Seq(0.0, 1.0).view.map{ d => d + math.random }
v: scala.collection.SeqView[Double,Seq[_]] = SeqViewM(...)

scala> v == v
res0: Boolean = false

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions