48 {
50 RuntimeType runtimeType = (RuntimeType)
type;
51 if (
type == typeof(
byte))
52 {
53 obj =
new ByteEqualityComparer();
54 }
55 else if (
type == typeof(
string))
56 {
57 obj =
new GenericEqualityComparer<string>();
58 }
59 else if (
type.IsAssignableTo(typeof(IEquatable<>).MakeGenericType(
type)))
60 {
61 obj = RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(GenericEqualityComparer<string>), runtimeType);
62 }
63 else if (
type.IsGenericType)
64 {
65 if (
type.GetGenericTypeDefinition() == typeof(Nullable<>))
66 {
68 }
69 }
71 {
73 }
74 return obj ?? RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(ObjectEqualityComparer<object>), runtimeType);
75 }
static object TryCreateEnumEqualityComparer(RuntimeType enumType)
static object TryCreateNullableEqualityComparer(RuntimeType nullableType)