diff --git a/src/Microsoft.DotNet.ApiCompat/src/Rules/Compat/ParameterModifiersCannotChange.cs b/src/Microsoft.DotNet.ApiCompat/src/Rules/Compat/ParameterModifiersCannotChange.cs index 03fa47e2f88..bcda21f01c0 100644 --- a/src/Microsoft.DotNet.ApiCompat/src/Rules/Compat/ParameterModifiersCannotChange.cs +++ b/src/Microsoft.DotNet.ApiCompat/src/Rules/Compat/ParameterModifiersCannotChange.cs @@ -129,8 +129,8 @@ private string GetReturnValueModifier(IMethodDefinition method) private class ModifierComparer : IEqualityComparer { - private readonly static IEqualityComparer TypeComparer = - CciComparers.Default.GetEqualityComparer(); + private readonly static IEqualityComparer TypeComparer = + CciComparers.Default.GetEqualityComparer(); private ModifierComparer() { } @@ -144,7 +144,7 @@ public bool Equals(ICustomModifier x, ICustomModifier y) } return x.IsOptional == y.IsOptional && - TypeComparer.Equals(x.Modifier.ResolvedType, y.Modifier.ResolvedType); + TypeComparer.Equals(x.Modifier, y.Modifier); } public int GetHashCode(ICustomModifier obj) @@ -154,7 +154,7 @@ public int GetHashCode(ICustomModifier obj) return 0; } - return (obj.IsOptional ? 1 : 0) | TypeComparer.GetHashCode(obj.Modifier.ResolvedType) << 1; + return (obj.IsOptional ? 1 : 0) | TypeComparer.GetHashCode(obj.Modifier) << 1; } } }