aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-05-08 11:15:16 +0200
committerMartin Odersky <odersky@gmail.com>2016-05-23 16:11:45 +0200
commit77498660dbef6cb34e5ebe5bb99647714d9ffeba (patch)
tree9cbfed268381ef2c18f8a9040e7aafc1e1dbae9c /src
parent25411d9c39a53e240673d14705f15ae07a979c65 (diff)
downloaddotty-77498660dbef6cb34e5ebe5bb99647714d9ffeba.tar.gz
dotty-77498660dbef6cb34e5ebe5bb99647714d9ffeba.tar.bz2
dotty-77498660dbef6cb34e5ebe5bb99647714d9ffeba.zip
Address reviewers comments
Diffstat (limited to 'src')
-rw-r--r--src/scala/Eq.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/scala/Eq.scala b/src/scala/Eq.scala
index 1ac6e55d2..8275ecee8 100644
--- a/src/scala/Eq.scala
+++ b/src/scala/Eq.scala
@@ -2,9 +2,9 @@ package scala
import annotation.implicitNotFound
-/** A marker trait indicating that values of kind `T` can be compared to values of type `U`. */
+/** A marker trait indicating that values of kind `L` can be compared to values of type `R`. */
@implicitNotFound("Values of types ${L} and ${R} cannot be compared with == or !=")
-trait Eq[-L, -R]
+sealed trait Eq[-L, -R]
/** Besides being a companion object, this object
* can also be used as a value that's compatible with
@@ -14,9 +14,9 @@ object Eq extends Eq[Any, Any] {
/** A fall-back implicit to compare values of any types.
* The compiler will restrict implicit instances of `eqAny`. An instance
- * `eqAny[T, U]` is _invalid_ if `T` or `U` is a non-bottom type that
- * has an implicit `Eq[T, T]` (respectively `Eq[U, U]`) instance.
- * An implicit search will fail instead of returning an invalid `eqAny` instance,
+ * `eqAny[T, U]` is _valid_ if `T <: U` or `U <: T` or both `T` and `U` are
+ * Eq-free. A type `S` is Eq-free if there is no implicit instance of `Eq[S, S]`.
+ * An implicit search will fail instead of returning an invalid `eqAny` instance.
*/
implicit def eqAny[L, R]: Eq[L, R] = Eq
}