diff --git a/src/AsmResolver.DotNet/Signatures/SignatureComparer.MemberReferences.cs b/src/AsmResolver.DotNet/Signatures/SignatureComparer.MemberReferences.cs index b34551836..cb0ec6507 100644 --- a/src/AsmResolver.DotNet/Signatures/SignatureComparer.MemberReferences.cs +++ b/src/AsmResolver.DotNet/Signatures/SignatureComparer.MemberReferences.cs @@ -44,6 +44,8 @@ public bool Equals(IMethodDescriptor? x, IMethodDescriptor? y) if (x is MethodSpecification specification) return Equals(specification, y as MethodSpecification); + else if (y is MethodSpecification) + return false; return x.Name == y.Name && Equals(x.DeclaringType, y.DeclaringType) diff --git a/src/AsmResolver.DotNet/Signatures/SignatureComparer.TypeSignature.cs b/src/AsmResolver.DotNet/Signatures/SignatureComparer.TypeSignature.cs index 185b24979..46341a3c8 100644 --- a/src/AsmResolver.DotNet/Signatures/SignatureComparer.TypeSignature.cs +++ b/src/AsmResolver.DotNet/Signatures/SignatureComparer.TypeSignature.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using AsmResolver.DotNet.Signatures; using AsmResolver.PE.DotNet.Metadata.Tables; namespace AsmResolver.DotNet.Signatures @@ -31,6 +30,8 @@ public bool Equals(TypeSignature? x, TypeSignature? y) return true; if (x is null || y is null) return false; + if (x.ElementType != y.ElementType) + return false; switch (x.ElementType) {