[Mono-bugs] [Bug 71488][Nor] New - Yet another generic problem gethashcode

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 19 Jan 2005 16:46:48 -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 spigaz@gmail.com.

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

--- shadow/71488	2005-01-19 16:46:48.000000000 -0500
+++ shadow/71488.tmp.4449	2005-01-19 16:46:48.000000000 -0500
@@ -0,0 +1,74 @@
+Bug#: 71488
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: Gentoo 2.6.7
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: spigaz@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Yet another generic problem gethashcode
+
+Description of Problem:
+This time its a problem with the hashcode of a generic type.
+
+Steps to reproduce the problem:
+1. Insert into a file
+
+namespace FLMID.Bugs.TrapOne
+{
+	public class A<T>
+
+	{
+
+		public A(T obj)
+
+		{
+			obj.GetHashCode();
+
+		}
+		public override int GetHashCode()
+
+		{
+
+			return -1;
+
+		}
+
+	}
+
+
+	public class Test
+	{
+		public static void Main(string[] args)
+		{
+			System.Console.Write("Start...");
+			
+			A<A<uint>> a = new A<A<uint>>(new A<uint>(0));
+			
+			System.Console.WriteLine("Ended!");
+		}		
+	}
+}
+
+2. Compile it
+3. Execute it
+
+Actual Results:
+Start... (And it gets killed)
+
+Expected Results:
+Start...Ended!
+
+How often does this happen? 
+Always
+
+Additional Information:
+Tested with .Net 2.0 (beta) and it worked fine.