Skip to content

Commit 59152e9

Browse files
Merge pull request #7844 from ashamukov/doc/intersection-types-typo
Typo fix and comment for intersection types' doc
2 parents 08f70cb + 0bb7087 commit 59152e9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/docs/reference/new-types/intersection-types-spec.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ When `C` is covariant, `C[A & B] <: C[A] & C[B]` can be derived:
5555
```
5656
A <: A B <: B
5757
---------- ---------
58-
A & B <: A A & B < B
58+
A & B <: A A & B <: B
5959
--------------- -----------------
6060
C[A & B] <: C[A] C[A & B] <: C[B]
6161
------------------------------------------
@@ -67,7 +67,7 @@ When `C` is contravariant, `C[A | B] <: C[A] & C[B]` can be derived:
6767
```
6868
A <: A B <: B
6969
---------- ---------
70-
A <: A | B B < A | B
70+
A <: A | B B <: A | B
7171
------------------- ----------------
7272
C[A | B] <: C[A] C[A | B] <: C[B]
7373
--------------------------------------------------
@@ -90,12 +90,14 @@ glb(A, B) = A if A extends B
9090
glb(A, B) = B if B extends A
9191
glb(A, _) = A if A is not a trait
9292
glb(_, B) = B if B is not a trait
93-
glb(A, _) = A
93+
glb(A, _) = A // use first
9494
```
9595

9696
In the above, `|T|` means the erased type of `T`, `JArray` refers to
9797
the type of Java Array.
9898

99+
See also: `TypeErasure#erasedGlb`
100+
99101
## Relationship with Compound Type (`with`)
100102

101103
Intersection types `A & B` replace compound types `A with B` in Scala 2. For the

0 commit comments

Comments
 (0)