//* // T is covariant // Implicit conversion from interface instance I<B> which has a method with RETURN type B // that is MORE derived than specified in target interface I<A> public interface I<out T> { T foo(); } public class IImp<T> : I<T> { public T foo() { return default(T); } } public class A { } public class B : A { } class Program { static void Main(string[] args) { I<A> ia = new IImp<B>(); } } /*/ // T is contravariant // Implicit conversion from interface instance I<A> which has a method with ARGUMENT type A // that is LESS derived than specified in target interface I<B> public interface I<in T> { void foo(T t); } public class IImp<T> : I<T> { public void foo(T t) { } } public class A { } public class B : A { } class Program { static void Main(string[] args) { I<B> ia = new IImp<A>(); } } //*/