From b2657665f782b5aa8d0e79752e03eca9a55363f7 Mon Sep 17 00:00:00 2001 From: ElektroKill Date: Tue, 28 May 2024 19:13:29 +0200 Subject: [PATCH] Add new `AllowByRefLike` generic parameter attribute --- src/DotNet/GenericParam.cs | 8 ++++++++ src/DotNet/GenericParamAttributes.cs | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/DotNet/GenericParam.cs b/src/DotNet/GenericParam.cs index 82cb469b4..942654bd7 100644 --- a/src/DotNet/GenericParam.cs +++ b/src/DotNet/GenericParam.cs @@ -260,6 +260,14 @@ public bool HasDefaultConstructorConstraint { set => ModifyAttributes(value, GenericParamAttributes.DefaultConstructorConstraint); } + /// + /// Gets/sets the bit + /// + public bool AllowsByRefLike { + get => ((GenericParamAttributes)attributes & GenericParamAttributes.AllowByRefLike) != 0; + set => ModifyAttributes(value, GenericParamAttributes.AllowByRefLike); + } + /// void IListListener.OnLazyAdd(int index, ref GenericParamConstraint value) => OnLazyAdd2(index, ref value); diff --git a/src/DotNet/GenericParamAttributes.cs b/src/DotNet/GenericParamAttributes.cs index 2b14fba24..d9ca467b2 100644 --- a/src/DotNet/GenericParamAttributes.cs +++ b/src/DotNet/GenericParamAttributes.cs @@ -27,5 +27,7 @@ public enum GenericParamAttributes : ushort { NotNullableValueTypeConstraint = 0x0008, /// type argument must have a public default constructor DefaultConstructorConstraint = 0x0010, + /// type argument can be ByRefLike + AllowByRefLike = 0x0020, } }