scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Improve the interactions between java.lang.Comparable and scala.math.Ordered #7017

Open scabug opened 11 years ago

scabug commented 11 years ago

A few years ago, Ordered was made a sub-class of Comparable.

One issue remained: Ordered used an abstract compare, while Comparable had an abstract compareTo. This was approached by implementing compareTo in Ordered in terms of compare.

Some issues remain with that solution:

Proposed solution:

Ordered implements compare in terms of Comparable's compareTo. A detailed overview of the existing usages will be necessary to figure out the least disruptive way of fixing this issue.

scabug commented 11 years ago

Imported From: https://issues.scala-lang.org/browse/SI-7017?orig=1 Reporter: @soc Affected Versions: 2.11.0-M1

scabug commented 10 years ago

@Ichoran said: Want me to take this one, Simon? Finding existing usages is one of my primary tasks these days. I'm not sure anything can be done, but when I've got the tooling in place at least I can assess.

scabug commented 8 years ago

@soc said: I think we should have a look whether we can alias Ordered to Comparable on the JVM, and add some warning, and let the compiler move the implementation from compare to compareTo in people's code.