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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=76750 --- shadow/76750 2005-12-06 22:02:05.000000000 -0500 +++ shadow/76750.tmp.22272 2005-12-07 11:20:14.000000000 -0500 @@ -1,12 +1,12 @@ Bug#: 76750 Product: Mono: Class Libraries Version: 1.1 OS: unknown OS Details: -Status: NEEDINFO +Status: REOPENED Resolution: Severity: Unknown Priority: Minor Component: CORLIB AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] @@ -34,6 +34,34 @@ Assert ("object ISN'T IComparable", !(o is IComparable)); ht.Add ("c", o); AssertEquals ("HT-Count", 3, ht.Count); SortedList sl = new SortedList (ht, null); AssertEquals ("SL-Count", 3, sl.Count); + +------- Additional Comments From [EMAIL PROTECTED] 2005-12-07 11:20 ------- +It's the keys that need to be IComparable, not the values, so if +you change the last Add to + ht.Add (o, "c"); +you'll get the error + + +A test case that works on .NET and fails on mono is: + +using System; +using System.Collections; + +public class SortedListTest : IComparer { + + public static void Main () + { + SortedList sl = new SortedList (new SortedListTest ()); + sl.Add (new object (), new object ()); + sl.Clone (); + } + + public int Compare (object x, object y) + { + return 0; + } +} + _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
