Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
enum System.Reflection.GenericParameterAttributes
Assembly: System.Runtime
Describes the constraints on a generic type parameter of a generic type or method.
Values
None
There are no special flags.
Covariant
The generic type parameter is covariant. A covariant type parameter can appear as the result type of a method, the type of a read-only field, a declared base type, or an implemented interface.
Contravariant
The generic type parameter is contravariant. A contravariant type parameter can appear as a parameter type in method signatures.
VarianceMask
Selects the combination of all variance flags. This value is the result of using logical OR to combine the following flags: <see cref="F:System.Reflection.GenericParameterAttributes.Contravariant" /> and <see cref="F:System.Reflection.GenericParameterAttributes.Covariant" /> .
ReferenceTypeConstraint
A type can be substituted for the generic type parameter only if it is a reference type.
NotNullableValueTypeConstraint
A type can be substituted for the generic type parameter only if it is a value type and is not nullable.
DefaultConstructorConstraint
A type can be substituted for the generic type parameter only if it has a parameterless constructor.
SpecialConstraintMask
Selects the combination of all special constraint flags. This value is the result of using logical OR to combine the following flags: <see cref="F:System.Reflection.GenericParameterAttributes.DefaultConstructorConstraint" /> , <see cref="F:System.Reflection.GenericParameterAttributes.ReferenceTypeConstraint" /> , and <see cref="F:System.Reflection.GenericParameterAttributes.NotNullableValueTypeConstraint" /> .
AllowByRefLike
The generic type parameter can be <c>ByRefLike</c> .