Skip to content

Commit 1da2145

Browse files
authored
Add new flag for ByRefLike constraints (#945)
* Add new flag for ByRefLike constraints * Allow seems to be the prefered nomenclature
1 parent dff01d9 commit 1da2145

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Mono.Cecil/GenericParameter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ public bool HasDefaultConstructorConstraint {
165165
set { attributes = attributes.SetAttributes ((ushort) GenericParameterAttributes.DefaultConstructorConstraint, value); }
166166
}
167167

168+
public bool AllowByRefLikeConstraint {
169+
get { return attributes.GetAttributes ((ushort) GenericParameterAttributes.AllowByRefLikeConstraint); }
170+
set { attributes = attributes.SetAttributes ((ushort) GenericParameterAttributes.AllowByRefLikeConstraint, value); }
171+
}
172+
168173
#endregion
169174

170175
public GenericParameter (IGenericParameterProvider owner)

Mono.Cecil/GenericParameterAttributes.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public enum GenericParameterAttributes : ushort {
2222
SpecialConstraintMask = 0x001c,
2323
ReferenceTypeConstraint = 0x0004,
2424
NotNullableValueTypeConstraint = 0x0008,
25-
DefaultConstructorConstraint = 0x0010
25+
DefaultConstructorConstraint = 0x0010,
26+
AllowByRefLikeConstraint = 0x0020,
2627
}
2728
}

0 commit comments

Comments
 (0)