[Mono-bugs] [Bug 67410][Wis] Changed - [PATCH] my_delegate == null calls MulticastDelegate::op_Equality

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 3 Oct 2004 20:59:32 -0400 (EDT)


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 bmaurer@users.sf.net.

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

--- shadow/67410	2004-10-03 20:57:17.000000000 -0400
+++ shadow/67410.tmp.22337	2004-10-03 20:59:32.000000000 -0400
@@ -1,23 +1,23 @@
 Bug#: 67410
 Product: Mono: Compilers
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Wishlist
 Component: C#
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: bmaurer@users.sf.net               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: my_delegate == null calls MulticastDelegate::op_Equality
+Summary: [PATCH] my_delegate == null calls MulticastDelegate::op_Equality
 
 Take the following test case:
 
 using System;
  
 class X {
@@ -38,6 +38,23 @@
 types that have operator overloads
 
 ------- Additional Comments From bmaurer@users.sf.net  2004-10-03 20:57 -------
 Created an attachment (id=11842)
 patch
 
+
+------- Additional Comments From bmaurer@users.sf.net  2004-10-03 20:59 -------
+This just generalizes the special case we already had for strings to
+handle other reference types.
+
+I'd note that this is not just an optimization. COnsider the following
+impl of equals:
+
+	public static bool operator == (X x, X y)
+	{
+		if ((object)x == (object)y)
+			return true;
+		
+		if (x == null || y == null)
+			return false;
+
+without my patch, this will become unbound recursion.