.NET equivalent for Java bounded wildcard (IInterf<?>)?
问题 I'm stuck trying to translate some Java code that uses (bounded) wildcard generics to C#. My problem is, Java seems to allow a generic type to be both covariant and contravariant when used with a wildcard. [This is a spin-off from a previous question dealing with a simpler case of bounded-wildcards] Java - works: class Impl { } interface IGeneric1<T extends Impl> { void method1(IGeneric2<?> val); T method1WithParam(T val); } interface IGeneric2<T extends Impl> { void method2(IGeneric1<?> val)