[Mono-bugs] [Bug 78322][Nor] New - Nullable<T>.Equals does not return true for null-null comparison

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun May 7 10:22:07 EDT 2006


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 nazgul at omega.pl.

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

--- shadow/78322	2006-05-07 10:22:07.000000000 -0400
+++ shadow/78322.tmp.3929	2006-05-07 10:22:07.000000000 -0400
@@ -0,0 +1,64 @@
+Bug#: 78322
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: nazgul at omega.pl               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Nullable<T>.Equals does not return true for null-null comparison
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Nullable<T>.Equals should return true when current instance is null and
+argument is null
+
+Steps to reproduce the problem:
+1. Compile and run:
+
+using System;
+using System.IO;
+
+
+struct X {
+  public int foo; 
+}
+
+class M {
+  static void f (int? x) {
+      bool isnull = x == null;  
+      bool iseq = x.Equals (null);
+      System.Console.WriteLine ("isnull={0} isequal={1} value={2}", isnull,
+iseq, x);
+  }
+
+   static void Main () {
+     f (1);  
+     f (null); 
+   } 
+}
+
+Actual Results:
+isnull=False isequal=False value=1
+isnull=True isequal=False value=
+
+
+Expected Results:
+isnull=False isequal=False value=1
+isnull=True isequal=True value=
+
+(from MS.NET)
+
+How often does this happen? 
+Always
+
+Additional Information:


More information about the mono-bugs mailing list