Skip to content

Commit dd3c3b6

Browse files
committed
Special case on statictyperesolver for enums
1 parent f45d1f7 commit dd3c3b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

YamlDotNet/Serialization/TypeResolvers/StaticTypeResolver.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public virtual Type Resolve(Type staticType, object? actualValue)
3232
{
3333
if (actualValue != null)
3434
{
35+
if (actualValue.GetType().IsEnum)
36+
{
37+
return staticType;
38+
}
39+
3540
switch (actualValue.GetType().GetTypeCode())
3641
{
3742
case TypeCode.Boolean: return typeof(bool);

0 commit comments

Comments
 (0)