Skip to content

Commit

Permalink
Add new flag for ByRefLike constraints (#945)
Browse files Browse the repository at this point in the history
* Add new flag for ByRefLike constraints

* Allow seems to be the prefered nomenclature
  • Loading branch information
jbevain authored May 21, 2024
1 parent dff01d9 commit 1da2145
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Mono.Cecil/GenericParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ 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); }
}

#endregion

public GenericParameter (IGenericParameterProvider owner)
Expand Down
3 changes: 2 additions & 1 deletion Mono.Cecil/GenericParameterAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public enum GenericParameterAttributes : ushort {
SpecialConstraintMask = 0x001c,
ReferenceTypeConstraint = 0x0004,
NotNullableValueTypeConstraint = 0x0008,
DefaultConstructorConstraint = 0x0010
DefaultConstructorConstraint = 0x0010,
AllowByRefLikeConstraint = 0x0020,
}
}

0 comments on commit 1da2145

Please sign in to comment.