Skip to content

Commit

Permalink
Use correct type for backward compatibility during binary serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo committed May 31, 2022
1 parent 8ee6d67 commit 481e782
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
if (!typeof(T).IsAssignableTo(typeof(IComparable<T>)))
{
// We used to use NullableComparer only for types implementing IComparable<T>
info.SetType(typeof(ObjectComparer<T>));
info.SetType(typeof(ObjectComparer<T?>));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
if (!typeof(T).IsAssignableTo(typeof(IEquatable<T>)))
{
// We used to use NullableComparer only for types implementing IEquatable<T>
info.SetType(typeof(ObjectEqualityComparer<T>));
info.SetType(typeof(ObjectEqualityComparer<T?>));
}
}

Expand Down

0 comments on commit 481e782

Please sign in to comment.