diff --git a/Mono.Cecil/GenericParameter.cs b/Mono.Cecil/GenericParameter.cs index de746449b..838646c08 100644 --- a/Mono.Cecil/GenericParameter.cs +++ b/Mono.Cecil/GenericParameter.cs @@ -150,6 +150,11 @@ public bool IsContravariant { set { attributes = attributes.SetMaskedAttributes ((ushort) GenericParameterAttributes.VarianceMask, (ushort) GenericParameterAttributes.Contravariant, value); } } + public bool HasNoSpecialConstraint { + get { return attributes.GetMaskedAttributes ((ushort) GenericParameterAttributes.SpecialConstraintMask, (ushort) GenericParameterAttributes.NoSpecialConstraint); } + set { attributes = attributes.SetMaskedAttributes ((ushort) GenericParameterAttributes.SpecialConstraintMask, (ushort) GenericParameterAttributes.NoSpecialConstraint, value); } + } + public bool HasReferenceTypeConstraint { get { return attributes.GetAttributes ((ushort) GenericParameterAttributes.ReferenceTypeConstraint); } set { attributes = attributes.SetAttributes ((ushort) GenericParameterAttributes.ReferenceTypeConstraint, value); } @@ -165,9 +170,9 @@ public bool HasDefaultConstructorConstraint { set { attributes = attributes.SetAttributes ((ushort) GenericParameterAttributes.DefaultConstructorConstraint, value); } } - public bool AllowByRefLikeConstraint { - get { return attributes.GetAttributes ((ushort) GenericParameterAttributes.AllowByRefLikeConstraint); } - set { attributes = attributes.SetAttributes ((ushort) GenericParameterAttributes.AllowByRefLikeConstraint, value); } + public bool AllowsByRefLike { + get { return attributes.GetAttributes ((ushort) GenericParameterAttributes.AllowByRefLike); } + set { attributes = attributes.SetAttributes ((ushort) GenericParameterAttributes.AllowByRefLike, value); } } #endregion diff --git a/Mono.Cecil/GenericParameterAttributes.cs b/Mono.Cecil/GenericParameterAttributes.cs index 51f094f47..3c2f0afd1 100644 --- a/Mono.Cecil/GenericParameterAttributes.cs +++ b/Mono.Cecil/GenericParameterAttributes.cs @@ -19,10 +19,11 @@ public enum GenericParameterAttributes : ushort { Covariant = 0x0001, Contravariant = 0x0002, - SpecialConstraintMask = 0x001c, + SpecialConstraintMask = 0x003c, + NoSpecialConstraint = 0x0000, ReferenceTypeConstraint = 0x0004, NotNullableValueTypeConstraint = 0x0008, DefaultConstructorConstraint = 0x0010, - AllowByRefLikeConstraint = 0x0020, + AllowByRefLike = 0x0020, } }