From ccb8887657bcfe8f5a9008fdc86c89cafd7c2562 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 1 Aug 2025 09:37:58 +0200 Subject: [PATCH] Move AllowByRefLike to SRMExtensions. --- ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs | 2 +- ICSharpCode.Decompiler/SRMHacks.cs | 2 ++ .../TypeSystem/Implementation/MetadataTypeParameter.cs | 2 +- ICSharpCode.Decompiler/TypeSystem/TypeUtils.cs | 2 -- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs b/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs index 81365516d..c433650d3 100644 --- a/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs +++ b/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs @@ -1734,7 +1734,7 @@ namespace ICSharpCode.Decompiler.Disassembler { output.Write("valuetype "); } - if ((gp.Attributes & TypeUtils.AllowByRefLike) == TypeUtils.AllowByRefLike) + if ((gp.Attributes & SRMExtensions.AllowByRefLike) == SRMExtensions.AllowByRefLike) { output.Write("byreflike "); } diff --git a/ICSharpCode.Decompiler/SRMHacks.cs b/ICSharpCode.Decompiler/SRMHacks.cs index 11d750fed..e155e7012 100644 --- a/ICSharpCode.Decompiler/SRMHacks.cs +++ b/ICSharpCode.Decompiler/SRMHacks.cs @@ -14,6 +14,8 @@ namespace ICSharpCode.Decompiler { public static partial class SRMExtensions { + internal const GenericParameterAttributes AllowByRefLike = (GenericParameterAttributes)0x0020; + public static ImmutableArray GetMethodImplementations( this MethodDefinitionHandle handle, MetadataReader reader) { diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeParameter.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeParameter.cs index 8fab173a9..3132f80fc 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeParameter.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeParameter.cs @@ -119,7 +119,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation public override bool HasDefaultConstructorConstraint => (attr & GenericParameterAttributes.DefaultConstructorConstraint) != 0; public override bool HasReferenceTypeConstraint => (attr & GenericParameterAttributes.ReferenceTypeConstraint) != 0; public override bool HasValueTypeConstraint => (attr & GenericParameterAttributes.NotNullableValueTypeConstraint) != 0; - public override bool AllowsRefLikeType => (attr & TypeUtils.AllowByRefLike) != 0; + public override bool AllowsRefLikeType => (attr & SRMExtensions.AllowByRefLike) != 0; public override bool HasUnmanagedConstraint { get { diff --git a/ICSharpCode.Decompiler/TypeSystem/TypeUtils.cs b/ICSharpCode.Decompiler/TypeSystem/TypeUtils.cs index 687dcf27d..8c42d38c5 100644 --- a/ICSharpCode.Decompiler/TypeSystem/TypeUtils.cs +++ b/ICSharpCode.Decompiler/TypeSystem/TypeUtils.cs @@ -27,8 +27,6 @@ namespace ICSharpCode.Decompiler.TypeSystem { public const int NativeIntSize = 6; // between 4 (Int32) and 8 (Int64) - public const GenericParameterAttributes AllowByRefLike = (GenericParameterAttributes)0x0020; - /// /// Gets the size (in bytes) of the input type. /// Returns NativeIntSize for pointer-sized types.