The partial modifier indicates that this interface-declaration is a partial type declaration. Multiple partial interface declarations with the same name within an enclosing namespace or type declaration combine to form one interface declaration, following the rules specified in §10.2.
Variant type parameter lists
Variant type parameter lists can only occur on interface and delegate types. The difference from ordinary type-parameter-lists is the optional variance-annotation on each type parameter.
variant-type-parameter-list:
< variant-type-parameters >
variant-type-parameters:
attributesopt variance-annotationopt type-parameter
variant-type-parameters , attributesopt variance-annotationopt type-parameter
variance-annotation:
in
out
If the variance annotation is out, the type parameter is said to be covariant. If the variance annotation is in, the type parameter is said to be contravariant. If there is no variance annotation, the type parameter is said to be invariant.
In the example
interface C
{
X M(Y y);
Z P { get; set; }
}
X is covariant, Y is contravariant and Z is invariant.
Do'stlaringiz bilan baham: |