aboutsummaryrefslogtreecommitdiff
path: root/library/src/scala/Eq.scala
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/scala/Eq.scala')
-rw-r--r--library/src/scala/Eq.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/library/src/scala/Eq.scala b/library/src/scala/Eq.scala
new file mode 100644
index 000000000..d6d617cab
--- /dev/null
+++ b/library/src/scala/Eq.scala
@@ -0,0 +1,14 @@
+package scala
+
+import annotation.implicitNotFound
+
+/** A marker trait indicating that values of type `L` can be compared to values of type `R`. */
+@implicitNotFound("Values of types ${L} and ${R} cannot be compared with == or !=")
+sealed trait Eq[-L, -R]
+
+/** Besides being a companion object, this object
+ * can also be used as a value that's compatible with
+ * any instance of `Eq`.
+ */
+object Eq extends Eq[Any, Any]
+