Hi, On Fri, Mar 2, 2012 at 11:21 PM, David Cornelson <[email protected]> wrote: > From looking at the source for Mono.Cecil, it appears that GetHashCode() and > Equals() are not implemented in relation to the given types > (MethodDefinition, PropertyDefinition, FieldDefinition).
They're not implemented as it's difficult to come up with a good answer to the question, are two types equal? Not only it's difficult but the answer may vary depending on arbitrary choices. > I'm assuming that if I recurse through the Instructions of a Method and they > are all the same, that the method bodies are equal. Then if we did the same > for Properties and Fields, we could have an Equals at the TypeDefinition > level too. Yes, you need to do a deep comparison of the method bodies. >> My guess is that some items come back with a signature from >> instantiation, and this signature is impacting the hash. I’m also >> picking up things like “PrivateImplementation” that are identical, but >> have GUIDS that make them not identical. How can I skip this properly? Well you just skip this type from your comparison. Jb -- -- mono-cecil
