From cc7c18cc9f9ff8717798c0925e22fa1b89ad0c64 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Tue, 1 Nov 2022 23:26:59 -0400 Subject: [PATCH] [mono] Avoid returning true from RuntimeType.IsActualEnum for generic parameters. Related: https://github.com/dotnet/runtime/pull/71685. --- src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs index eed3d75c60bd5..08484d246a504 100644 --- a/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/RuntimeType.Mono.cs @@ -1277,7 +1277,7 @@ protected override bool IsValueTypeImpl() public override bool IsEnum => GetBaseType() == EnumType; // Returns true for actual enum types only. - internal bool IsActualEnum => RuntimeTypeHandle.GetBaseType(this) == EnumType; + internal bool IsActualEnum => !IsGenericParameter && RuntimeTypeHandle.GetBaseType(this) == EnumType; public override GenericParameterAttributes GenericParameterAttributes {