-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Take the following paragraph:
In general, a covariant type parameter can be used as the return type of a delegate, and contravariant type parameters can be used as parameter types. For an interface, covariant type parameters can be used as the return types of the interface's methods, and contravariant type parameters can be used as the parameter types of the interface's methods.
This is a wall of text. Readers will have to develop a mental model of what it all means. But if supplemented with a code sample, it would be inordinately helpful, and an order of magnitude more descriptive, especially for people who are speaking english as a second language. my two cents.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 74e47b2d-ee75-bd2e-4857-7704af641a2a
- Version Independent ID: 8055442b-8ecf-e869-3e48-a5c4ee5207a1
- Content: Covariance and Contravariance in Generics
- Content Source: docs/standard/generics/covariance-and-contravariance.md
- Product: dotnet-fundamentals
- GitHub Login: @adegeo
- Microsoft Alias: adegeo