[Mono-bugs] [Bug 50901][Nor] New - ValueType.Equals and ValueType.GetHashCode should reflect/compare members

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 12 Nov 2003 19:44:27 -0500 (EST)


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=50901

--- shadow/50901	2003-11-12 19:44:27.000000000 -0500
+++ shadow/50901.tmp.28937	2003-11-12 19:44:27.000000000 -0500
@@ -0,0 +1,44 @@
+Bug#: 50901
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ValueType.Equals and ValueType.GetHashCode should reflect/compare members
+
+Description of Problem:
+The impl of ValueType.Equals/GetHashCode should search for all fields and
+call the respective method on them. For GetHashCode it should xor the
+values together. For Equals it should return true only if all the fields
+are equal.
+
+Steps to reproduce the problem:
+class lala {
+	static void Main () {
+		blah a = new blah ("abc"), b = new blah (string.Format ("ab{0}", 'c'));
+		System.Console.WriteLine (a.Equals (b));
+	}
+	struct blah { 
+		public string s;
+		public blah (string s) { this.s = s; }
+	}
+}
+
+Actual Results:
+False
+
+Expected Results:
+True
+
+How often does this happen? 
+Always