Skip to content

Commit fb2353d

Browse files
committed
Tweaks to Any and AnyRef documentation, courtes...
Tweaks to Any and AnyRef documentation, courtesy of Seth Tisue. No review.
1 parent 7589049 commit fb2353d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/library-aux/scala/Any.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ package scala
1414
abstract class Any {
1515
/** Compares the receiver object (`this`) with the argument object (`that`) for equivalence.
1616
*
17-
* The default implementations of this method is an [[http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]]:
17+
* Any implementation of this method should be an [[http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]]:
1818
*
1919
* - It is reflexive: for any instance `x` of type `Any`, `x.equals(x)` should return `true`.
2020
* - It is symmetric: for any instances `x` and `y` of type `Any`, `x.equals(y)` should return `true` if and
@@ -61,6 +61,7 @@ abstract class Any {
6161
def getClass(): Class[_]
6262

6363
/** Test two objects for equality.
64+
* The expression `x == that` is equivalent to `if (x eq null) that eq null else x.equals(that)`.
6465
*
6566
* @param that the object to compare against this object for equality.
6667
* @return `true` if the receiver object is equivalent to the argument; `false` otherwise.

src/library-aux/scala/AnyRef.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ package scala
1313
*/
1414
trait AnyRef extends Any {
1515

16-
/** The equality method for reference types. See equals in [[scala.Any]].
16+
/** The equality method for reference types. Default implementation delegates to `eq`.
17+
*
18+
* See also `equals` in [[scala.Any]].
1719
*
1820
* @param that the object to compare against this object for equality.
1921
* @return `true` if the receiver object is equivalent to the argument; `false` otherwise.

0 commit comments

Comments
 (0)