.Net Contravariance & Covariance notes
Variant == Contravariant or Covariant. Invariant == NOT (Contravariant or Covariant) All next members of an interface will result in compilation errors. interface IVariant < out TReturn , in TArgument > { // CS1961 Invalid variance: // The type parameter 'TReturn' must be contravariantly valid on 'IVariant<TReturn, TArgument>.SetA(TReturn)'. // 'TReturn' is covariant. void SetA( TReturn smpleArg); // CS1961 Invalid variance: // The type parameter 'TArgument' must be covariantly valid on 'IVariant<TReturn, TArgument>.GetA()'. // 'TArgument' is contravariant. TArgument GetA(); // CS1961 Invalid variance: // The type parameter 'TArgument' must be covariantly valid on 'IVariant<TReturn, TArgument>.GetASetR(TReturn)'. // 'TA...