Skip to content

Commit 0f6ea2a

Browse files
Merge pull request #7197 from robstoll/patch-12
[doc] improve Eql precise rules + typo and format
2 parents 5687b18 + be62946 commit 0f6ea2a

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

docs/docs/reference/contextual/multiversal-equality.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,21 @@ The precise rules for equality checking are as follows.
112112

113113
If the `strictEquality` feature is enabled then
114114
a comparison using `x == y` or `x != y` between values `x: T` and `y: U`
115-
is legal if
116-
117-
1. there is a given instance for `Eql[T, U]`, or
118-
2. one of `T`, `U` is `Null`.
115+
is legal if there is a given instance for `Eql[T, U]`.
119116

120117
In the default case where the `strictEquality` feature is not enabled the comparison is
121118
also legal if
122119

123-
1. `T` and `U` the same, or
124-
2. one of `T` and `U`is a subtype of the _lifted_ version of the other type, or
125-
3. neither `T` nor `U` have a _reflexive `Eql` given.
120+
1. `T` and `U` are the same, or
121+
2. one of `T`, `U` is a subtype of the _lifted_ version of the other type, or
122+
3. neither `T` nor `U` have a _reflexive_ `Eql` given.
126123

127124
Explanations:
128125

129126
- _lifting_ a type `S` means replacing all references to abstract types
130127
in covariant positions of `S` by their upper bound, and to replacing
131128
all refinement types in covariant positions of `S` by their parent.
132-
- a type `T` has a _reflexive `Eql` given if the implicit search for `Eql[T, T]`
129+
- a type `T` has a _reflexive_ `Eql` given if the implicit search for `Eql[T, T]`
133130
succeeds.
134131

135132
## Predefined Eql Instances
@@ -139,7 +136,7 @@ The `Eql` object defines givens for comparing
139136
- `java.lang.Number`, `java.lang.Boolean`, and `java.lang.Character`,
140137
- `scala.collection.Seq`, and `scala.collection.Set`.
141138

142-
Given instances are defined so that every one of these types has a reflexive `Eql` given, and the following holds:
139+
Given instances are defined so that every one of these types has a _reflexive_ `Eql` given, and the following holds:
143140

144141
- Primitive numeric types can be compared with each other.
145142
- Primitive numeric types can be compared with subtypes of `java.lang.Number` (and _vice versa_).

0 commit comments

Comments
 (0)