Eric Lippert is on the C# Compiler team and has written a series of posts on this topic that are an absolute must-read!
- Part One
- Part Two: Array Covariance (and Why is covariance of value-typed arrays inconsistent?)
- Part Three: Method Group Conversion Variance
- Part Four: Real Delegate Variance
- Part Five: Higher Order Functions Hurt My Brain
- Part Six: Interface Variance
- Part Seven: Why Do We Need A Syntax
- Part Eight: Syntax Options
- Part Nine: Breaking Changes
- Part Ten: Dealing With Ambiguity
- Part Eleven: To infinity, but not beyond
MSDN
The information here is quite “flat”, but still worth a read.
More
- Microsoft Research: Variance and Generalized Constraints
Pages 1-9, OK. After that I can’t follow anymore. - Exact rules for variance validity
Compiler details - Wikipedia
Very poorly written, if you ask me.
Category Theory
The names covariance and contravariance in C# derive from co- and contravariant functors described in category theory.
- Wikipedia
- A Gentle Introduction to Category Theory
- What’s the difference between covariance and assignment compatibility?
How category theory applies to C# Co- and Contravariance
Hope that helps!