Skip to content

Commit b51087b

Browse files
authored
Merge pull request scala#1006 from IDispose/patch-1
used proper singular. A instead of AN
2 parents 3706fc9 + 783845b commit b51087b

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
@@ -147,7 +147,7 @@ abstract class SmallAnimal extends Animal
147147
case class Mouse(name: String) extends SmallAnimal
148148
```
149149

150-
Suppose we're working with functions that accept types of animals, and return the types of food they eat. If we would like a `Cat => SmallAnimal` (because cats eat small animals), but are given a `Animal => Mouse` instead, our program will still work. Intuitively an `Animal => Mouse` will still accept a `Cat` as an argument, because a `Cat` is an `Animal`, and it returns a `Mouse`, which is also an `SmallAnimal`. Since we can safely and invisibly substitute the former for the latter, we can say `Animal => Mouse` is a subtype of `Cat => SmallAnimal`.
150+
Suppose we're working with functions that accept types of animals, and return the types of food they eat. If we would like a `Cat => SmallAnimal` (because cats eat small animals), but are given a `Animal => Mouse` instead, our program will still work. Intuitively an `Animal => Mouse` will still accept a `Cat` as an argument, because a `Cat` is an `Animal`, and it returns a `Mouse`, which is also a `SmallAnimal`. Since we can safely and invisibly substitute the former for the latter, we can say `Animal => Mouse` is a subtype of `Cat => SmallAnimal`.
151151

152152
### Comparison With Other Languages
153153

0 commit comments

Comments
 (0)