case fails for vectors with negative numbers
The last case should return true like the other,
Real life example that triggered this:
Explaination: This is caused by `case` using `hashCode` instead of hashEq for hash comparisons (when not wrapped in a vector, the comparison is direct) and the fact that negative integers and negative longs hash differently while positive ones hash identical.
Porposal: Make `case` use hasheq instead of hashCode
Prescreened by: Alex Miller
I just reset my env and can't repro it either. I must have had something out of whack, sorry about that.
I couldn’t repro this failure on a clean clojure checkout + this patch
Test fails w/current patch:
Just thinking through this from a backwards compatibility point of view with respect to the change in Compiler... hashes are computed both in the case macro and by the AOT compiled code. Trying to think through whether a combination of new core lib with old AOT class would create an issue. I guess everything that needs to sync up is in the class file so it should be fine, but this is a case we should test manually to double-check.
Patch is a straightforward search and replace, apart from line 30 of the diff which is quite tricky: I believe using `h` there was a bug in the previous impl that never survaced because hashCode on positive integers is idempotent. But since hashEq isn't double hashing would cause collision nodes never to match.