From af6a59a0d9c02cd57685e493623b1c1c6bcaeb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=2E=20Galambos=20M=C3=A1t=C3=A9?= Date: Mon, 11 Nov 2024 13:12:55 +0100 Subject: [PATCH] Update Generics.md You messed up the thing you were explaining --- .../copy/en/handbook-v2/Type Manipulation/Generics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Generics.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Generics.md index 152c61812277..bffbc2496562 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Generics.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Generics.md @@ -449,7 +449,7 @@ interface Consumer { consume: (arg: T) => void; } ``` -Then we can use a `Consumer` where a `Consumer` is expected, because any function that is capable of accepting a `Cat` must also be capable of accepting an `Animal`. +Then we can use a `Consumer` where a `Consumer` is expected, because any function that is capable of accepting an `Animal` must also be capable of accepting a `Cat`. This relationship is called *contravariance*: the relationship from `Consumer` to `Consumer` is the same as the relationship from `U` to `T`. Note the reversal of direction as compared to covariance! This is why contravariance "cancels itself out" but covariance doesn't.