Skip to content

Commit ae5695e

Browse files
Corrected covariance definition
1 parent 689c287 commit ae5695e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_tour/variances.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Baz[A] // An invariant class
2020

2121
### Covariance
2222

23-
A type parameter `A` of a generic class can be made covariant by using the annotation `+A`. For some `class List[+A]`, making `A` covariant implies that for two types `A` and `B` where `A` is a subtype of `B`, then `List[A]` is a subtype of `List[B]`. This allows us to make very useful and intuitive subtyping relationships using generics.
23+
A type parameter `A` of a generic class can be made covariant by using the annotation `+A`. For some `class List[+A]`, making `A` covariant implies that for two types `A` and `B` where `B` is a subtype of `A`, then `List[B]` is a subtype of `List[A]`. This allows us to make very useful and intuitive subtyping relationships using generics.
2424

2525
Consider this simple class structure:
2626

0 commit comments

Comments
 (0)