[Mono-list] Int32.CompareTo() bug

Miguel de Icaza miguel@ximian.com
28 Nov 2001 16:55:18 -0500


> Int32.CompareTo(object v) has a bug.  Your solution is to return the
> difference (which seems obvious):
> 	return value - (int) v;

Wow!  Thanks for catching this one.  I have fixed this in CVS for all
the classes that had that problem.

> Oh yeah, and bug #2.  The docs say that if v is null, CompareTo() should
> return a value greater than zero.  It seems that you throw an exception.

Fixed this as well on all of our corlib/System now.

I will be committing soon.

Miguel.