Skip to content

Commit 4099a2e

Browse files
committed
supply a missing variance annotation
1 parent 060137f commit 4099a2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tutorials/tour/_posts/2017-02-13-variances.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Fortunately, the compiler stops us long before we could get this far.
135135

136136
### Other Examples
137137

138-
Another example that can help one understand variance is `trait Function1[-T, R]` from the Scala standard library. `Function1` represents a function with one argument, where the first type parameter `T` represents the argument type, and the second type parameter `R` represents the return type. A `Function1` is contravariant over its argument type, and covariant over its return type. For this example we'll use the literal notation `A => B` to represent a `Function1[A, B]`.
138+
Another example that can help one understand variance is `trait Function1[-T, +R]` from the Scala standard library. `Function1` represents a function with one argument, where the first type parameter `T` represents the argument type, and the second type parameter `R` represents the return type. A `Function1` is contravariant over its argument type, and covariant over its return type. For this example we'll use the literal notation `A => B` to represent a `Function1[A, B]`.
139139

140140
Assume the similar `Cat`, `Dog`, `Animal` inheritance tree used earlier, plus the following:
141141

0 commit comments

Comments
 (0)