Skip to content

Commit

Permalink
add check for typeof(void) - possibly workaround dotnet#71339
Browse files Browse the repository at this point in the history
  • Loading branch information
krwq committed Jun 27, 2022
1 parent 39b0578 commit 41f3d50
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ internal static void ValidateType(Type type, Type? parentClassType, MemberInfo?

internal static bool IsInvalidForSerialization(Type type)
{
return type.IsPointer || type.IsByRef || IsByRefLike(type) || type.ContainsGenericParameters;
return type == typeof(void) || type.IsPointer || type.IsByRef || IsByRefLike(type) || type.ContainsGenericParameters;
}

private static bool IsByRefLike(Type type)
Expand Down

0 comments on commit 41f3d50

Please sign in to comment.