A generic method can use contravariant/covariant types?
问题 I'm writting a generalized method to use it in a special task at a T4 template. The method should allow me to use specialized types from a general interface. I thought about the following signatures: interface IGreatInterface { Object aMethodAlpha<U>(U parameter) where U : IAnInterface; Object aMethodBeta(IAnInterface parameter) } public class AnInterestingClass : IAnInterface{} When I try to implement IGreatInterface the compiler flags an error for aMethodBeta() because I've made my T4 to