Equality comparers fixes
authorMarek Safar <marek.safar@gmail.com>
Thu, 9 Apr 2015 20:53:45 +0000 (22:53 +0200)
committerMarek Safar <marek.safar@gmail.com>
Mon, 2 May 2016 22:08:10 +0000 (00:08 +0200)
mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs

index 89bb8d10bcf50b0195e7257e84441b413a4891af..693a7dd1e056cf146f784034e13e5793047d5e82 100644 (file)
@@ -73,7 +73,7 @@ namespace System.Collections.Generic
                 RuntimeType u = (RuntimeType)t.GetGenericArguments()[0];
                 if (typeof(IEquatable<>).MakeGenericType(u).IsAssignableFrom(u)) {
 #if MONO
-                    return (EqualityComparer<T>)RuntimeType.CreateInstanceForAnotherGenericParameter (typeof(NullableEqualityComparer<>), t);
+                    return (EqualityComparer<T>)RuntimeType.CreateInstanceForAnotherGenericParameter (typeof(NullableEqualityComparer<>), u);
 #else
                     return (EqualityComparer<T>)RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(NullableEqualityComparer<int>), u);
 #endif
@@ -423,7 +423,6 @@ namespace System.Collections.Generic
         }
     }
 
-#if MOBILE
     [Serializable]
     sealed class InternalStringComparer : EqualityComparer<string> {
     
@@ -456,7 +455,6 @@ namespace System.Collections.Generic
             return -1;
         }
     }
-#endif
 
 #if FEATURE_RANDOMIZED_STRING_HASHING
     // This type is not serializeable by design.  It does not exist in previous versions and will be removed