Skip to content

Commit

Permalink
Merge pull request #8191 from NthPortal/topic/ordering-double-depreca…
Browse files Browse the repository at this point in the history
…tion-message

Tweak deprecation messages for Ordering[{Float,Double}]
  • Loading branch information
lrytz committed Jul 1, 2019
2 parents ec7018e + bffdf23 commit b2a4255
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/library/scala/math/Ordering.scala
Expand Up @@ -424,7 +424,7 @@ object Ordering extends LowPriorityOrderingImplicits {
}
@deprecated("There are multiple ways to order Floats (Ordering.Float.TotalOrdering, " +
"Ordering.Float.IeeeOrdering). Specify one by using a local import, assigning an implicit val, or passing it " +
"explicitly. See the documentation for details.", since = "2.13.0")
"explicitly. See their documentation for details.", since = "2.13.0")
implicit object DeprecatedFloatOrdering extends Float.TotalOrdering

/** `Ordering`s for `Double`s.
Expand Down Expand Up @@ -484,7 +484,7 @@ object Ordering extends LowPriorityOrderingImplicits {
}
@deprecated("There are multiple ways to order Doubles (Ordering.Double.TotalOrdering, " +
"Ordering.Double.IeeeOrdering). Specify one by using a local import, assigning an implicit val, or passing it " +
"explicitly. See the documentation for details.", since = "2.13.0")
"explicitly. See their documentation for details.", since = "2.13.0")
implicit object DeprecatedDoubleOrdering extends Double.TotalOrdering

trait BigIntOrdering extends Ordering[BigInt] {
Expand Down
6 changes: 3 additions & 3 deletions test/files/neg/t10511.check
@@ -1,10 +1,10 @@
t10511.scala:3: warning: object DeprecatedFloatOrdering in object Ordering is deprecated (since 2.13.0): There are multiple ways to order Floats (Ordering.Float.TotalOrdering, Ordering.Float.IeeeOrdering). Specify one by using a local import, assigning an implicit val, or passing it explicitly. See the documentation for details.
t10511.scala:3: warning: object DeprecatedFloatOrdering in object Ordering is deprecated (since 2.13.0): There are multiple ways to order Floats (Ordering.Float.TotalOrdering, Ordering.Float.IeeeOrdering). Specify one by using a local import, assigning an implicit val, or passing it explicitly. See their documentation for details.
val f = Ordering[Float]
^
t10511.scala:4: warning: object DeprecatedDoubleOrdering in object Ordering is deprecated (since 2.13.0): There are multiple ways to order Doubles (Ordering.Double.TotalOrdering, Ordering.Double.IeeeOrdering). Specify one by using a local import, assigning an implicit val, or passing it explicitly. See the documentation for details.
t10511.scala:4: warning: object DeprecatedDoubleOrdering in object Ordering is deprecated (since 2.13.0): There are multiple ways to order Doubles (Ordering.Double.TotalOrdering, Ordering.Double.IeeeOrdering). Specify one by using a local import, assigning an implicit val, or passing it explicitly. See their documentation for details.
val d = Ordering[Double]
^
t10511.scala:7: warning: object DeprecatedDoubleOrdering in object Ordering is deprecated (since 2.13.0): There are multiple ways to order Doubles (Ordering.Double.TotalOrdering, Ordering.Double.IeeeOrdering). Specify one by using a local import, assigning an implicit val, or passing it explicitly. See the documentation for details.
t10511.scala:7: warning: object DeprecatedDoubleOrdering in object Ordering is deprecated (since 2.13.0): There are multiple ways to order Doubles (Ordering.Double.TotalOrdering, Ordering.Double.IeeeOrdering). Specify one by using a local import, assigning an implicit val, or passing it explicitly. See their documentation for details.
list.sorted
^
error: No warnings can be incurred under -Werror.
Expand Down

0 comments on commit b2a4255

Please sign in to comment.