Skip to content

Commit

Permalink
[mono] Avoid returning true from RuntimeType.IsActualEnum for generic…
Browse files Browse the repository at this point in the history
… parameters. (#77763)

Related: #71685.
  • Loading branch information
vargaz committed Nov 3, 2022
1 parent fbc2057 commit 5d0943f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 5d0943f

Please sign in to comment.