﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Oran commented on Method Equality</title><description>"the comparison is made of the closed generic version of the type" - actually, it's not.  GetType().GetMethod("Compare").DeclaringType is closed.  MethodInfo.GetCurrentMethod().DeclaringType is open.  See the Community Content section for MethodBase.GetCurrentMethod for details:
  
http://msdn2.microsoft.com/en-us/library/system.reflection.methodbase.getcurrentmethod.aspx
  
  
Basically, MethodBase.GetCurrentMethod doesn't behave as one would expect.
  
  
Also notice that ContainsGenericParameters is false in the first MethodInfo while it is true in the second.  According to the following link, this means the second one is an open constructed generic method:
  
http://blogs.msdn.com/parthopdas/archive/2005/10/21/483463.aspx
</description><link>http://ayende.com/2658/method-equality#comment7</link><guid>http://ayende.com/2658/method-equality#comment7</guid><pubDate>Sat, 28 Jul 2007 04:11:58 GMT</pubDate></item><item><title>Ayende Rahien commented on Method Equality</title><description>Thomas , 
  
Great catch, I'll add that 
</description><link>http://ayende.com/2658/method-equality#comment6</link><guid>http://ayende.com/2658/method-equality#comment6</guid><pubDate>Fri, 27 Jul 2007 19:37:28 GMT</pubDate></item><item><title>Ayende Rahien commented on Method Equality</title><description>Yes, because if it has the same declaring type, and the same name &amp; parameters, you can define another method with a different name
</description><link>http://ayende.com/2658/method-equality#comment5</link><guid>http://ayende.com/2658/method-equality#comment5</guid><pubDate>Fri, 27 Jul 2007 19:36:29 GMT</pubDate></item><item><title>Thomas Krause commented on Method Equality</title><description>Shouldn't you also check the method name for equality?
  
  
Two methods could be declared on the same class with the same signature (parameters and return type) but different names. The Hash code will of course be different in most of the cases, but this isn't guaranteed... Am I missing something here?
</description><link>http://ayende.com/2658/method-equality#comment4</link><guid>http://ayende.com/2658/method-equality#comment4</guid><pubDate>Fri, 27 Jul 2007 16:34:59 GMT</pubDate></item><item><title>josh commented on Method Equality</title><description>Nice solution. What about method access privileges on each? What if one method is public and the other is internal or protected? Should they still be considered equal to each other?
  
  
</description><link>http://ayende.com/2658/method-equality#comment3</link><guid>http://ayende.com/2658/method-equality#comment3</guid><pubDate>Fri, 27 Jul 2007 15:34:20 GMT</pubDate></item><item><title>Ayende Rahien commented on Method Equality</title><description>I mean by the method object itself, no delegates involved.
  
This is probably mentioned in the docs, but I have no idea where
</description><link>http://ayende.com/2658/method-equality#comment2</link><guid>http://ayende.com/2658/method-equality#comment2</guid><pubDate>Fri, 27 Jul 2007 11:11:13 GMT</pubDate></item><item><title>Mark Monster commented on Method Equality</title><description>What do you mean by method instantiation? Instantiation using delegates for named and anonymous method? 
</description><link>http://ayende.com/2658/method-equality#comment1</link><guid>http://ayende.com/2658/method-equality#comment1</guid><pubDate>Fri, 27 Jul 2007 11:04:30 GMT</pubDate></item></channel></rss>