A contravariant delegate can be assigned another delegate of the same type, but with a less derived generic type parameter.
可以向逆变委托分配同一类型的其他委托,但需使用派生程度较小的泛型类型参数。
An interface that has a contravariant type parameter allows its methods to accept arguments of less derived types than those specified by the interface type parameter.
如果接口具有逆变类型形参,则允许其方法接受与接口类型形参指定的派生类型相比,派生程度更小的类型的实参。
That's what interface inheritance means; if you fulfill the contract of the more derived type then you are required to also fulfill the contract of the less derived type.
接口继承就是这样的;如果你要满足派生程度较高的类型的契约的话,你就必须要满足派生程度较低的类型。
应用推荐