The purpose of variance annotations is to provide for more lenient (but still type safe) conversions to interface and delegate types. To this end the definitions of implicit (§6.1) and explicit conversions (§6.2) make use of the notion of variance-convertibility, which is defined as follows:
A type T1, …, An> is variance-convertible to a type T1, …, Bn> if T is either an interface or a delegate type declared with the variant type parameters T1, …, Xn>, and for each variant type parameter Xi one of the following holds:
Do'stlaringiz bilan baham: |