From 481e782cc2ab53285a51b61f124e39de5c5bdcc8 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Tue, 31 May 2022 16:29:45 +0200 Subject: [PATCH] Use correct type for backward compatibility during binary serialization --- .../src/System/Collections/Generic/Comparer.cs | 2 +- .../src/System/Collections/Generic/EqualityComparer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Comparer.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Comparer.cs index 1e0ddf0b4b177..22cc2f3aac02c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Comparer.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Comparer.cs @@ -86,7 +86,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) if (!typeof(T).IsAssignableTo(typeof(IComparable))) { // We used to use NullableComparer only for types implementing IComparable - info.SetType(typeof(ObjectComparer)); + info.SetType(typeof(ObjectComparer)); } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.cs index 127f35d150b9c..60a65072a41f9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.cs @@ -106,7 +106,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) if (!typeof(T).IsAssignableTo(typeof(IEquatable))) { // We used to use NullableComparer only for types implementing IEquatable - info.SetType(typeof(ObjectEqualityComparer)); + info.SetType(typeof(ObjectEqualityComparer)); } }