[Mono-bugs] [Bug 74987][Nor] New - Delegate.Equals throws InvalidCastException when comparing non-delegates

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed May 18 07:33:31 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ximian-bugzilla at winsper.org.uk.

http://bugzilla.ximian.com/show_bug.cgi?id=74987

--- shadow/74987	2005-05-18 07:33:31.000000000 -0400
+++ shadow/74987.tmp.25060	2005-05-18 07:33:31.000000000 -0400
@@ -0,0 +1,40 @@
+Bug#: 74987
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 001 One hour
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: ximian-bugzilla at winsper.org.uk               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Delegate.Equals throws InvalidCastException when comparing non-delegates
+
+Description of Problem:
+If you call Delegate.Equals(object) with an object that is not an instance
+of a Delegate, it will throw an InvalidCastException.  This is very bad
+when, for example, you have an ArrayList of heterogenous types and call
+ArrayList.Remove(object).
+
+Steps to reproduce the problem:
+1. Create an instance of a Delegate object.
+2. Call delegateobj.Equals(object) with a non-null object that is not a
+Delegate.
+
+Actual Results:
+Uncaught InvalidCastException.
+
+Expected Results:
+"not equal" written to the console.
+
+How often does this happen? 
+All the time.
+
+Additional Information:
+I have a fix that I'm about to attach.


More information about the mono-bugs mailing list