Add variance summary image

This commit is contained in:
Marcello 2021-10-27 14:05:47 +02:00
parent ea59857f4b
commit 0fd87958af
2 changed files with 2 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -2032,6 +2032,8 @@ Generic type parameters support covariance and contravariance to provide greater
- **Contravariance**: Enables to use a more generic (less derived) type than originally specified. - **Contravariance**: Enables to use a more generic (less derived) type than originally specified.
- **Invariance**: it's possible to use _only_ the type originally specified; so an invariant generic type parameter is neither covariant nor contravariant. - **Invariance**: it's possible to use _only_ the type originally specified; so an invariant generic type parameter is neither covariant nor contravariant.
![covariance-vs-contravariance](../../.images/dotnet_covariant_contravariant.png)
**NOTE**: annotate generic type parameters with `out` and `in` annotations to specify whether they should behave covariantly or contravariantly. **NOTE**: annotate generic type parameters with `out` and `in` annotations to specify whether they should behave covariantly or contravariantly.
```cs ```cs