This comparer is only suitable for hash tables; it doesn't provide a valid (commutative) ordering of items.
Note that in general, boxed values are not equal, even if the unboxed values would be. The current code makes a special case for ints, which behave as expected. This used to be class ListComparer