From 5d0943f0ce25d137690ca339a254a25cdac39796 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 2 Nov 2022 20:48:15 -0400 Subject: [PATCH] [mono] Avoid returning true from RuntimeType.IsActualEnum for generic parameters. (#77763) 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 {