[Mono-bugs] [Bug 77399][Nor] Changed - [GMCS] consistent crash using SortedList with non-primitive key

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Feb 10 10:19:40 EST 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 martin at ximian.com.

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

--- shadow/77399	2006-02-10 08:56:06.000000000 -0500
+++ shadow/77399.tmp.26581	2006-02-10 10:19:40.000000000 -0500
@@ -98,6 +98,28 @@
 .
 
 ------- Additional Comments From vargaz at gmail.com  2006-02-10 08:56 -------
 The testcase I attached compiles and runs on MS.NET, and doesn't throw
 any exception.
 
+
+------- Additional Comments From martin at ximian.com  2006-02-10 10:19 -------
+It does throw an exception if you have a broken Comparer<T>.Default
+implementation.  Before I fixed it, Comparer<T>.Default returned an
+instance of
+
+----
+class IComparableOfT<T> : Comparer<T> where T : IComparable
+{ .... }
+----
+
+this is wrong because ClassA only implements IComparable<T> and not
+IComparable - so the constraint is not met.  The bug is that our
+runtime doesn't catch this.
+
+I fixed that to
+
+----
+class IComparableOfT<T> : Comparer<T> where T : IComparable<T>
+{ .... }
+----
+


More information about the mono-bugs mailing list