Skip to content

Commit 33c5f84

Browse files
authored
Merge pull request #844 from jbalintbiro/patch-2
Variances: fix signiture of Function1
2 parents 270b200 + 274ae72 commit 33c5f84

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
@@ -138,7 +138,7 @@ Fortunately, the compiler stops us long before we could get this far.
138138

139139
### Other Examples
140140

141-
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]`.
141+
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]`.
142142

143143
Assume the similar `Cat`, `Dog`, `Animal` inheritance tree used earlier, plus the following:
144144

0 commit comments

Comments
 (0)