= on sorted collections with different key types still incorrectly throws

Description

partially fixed = throwing an exception when comparing with sorted collections, but there are still cases where this will throw.

Some of the tests in the original patch on also still throw exceptions. - https://dev.clojure.org/jira/secure/attachment/12084/0001-fix-for-CLJ-1242-tests.patch.

Note that this is not symmetrical, the reverse doesn't throw.

Environment

None

Activity

Show:
Daniel Compton
March 6, 2018, 8:47 PM

This issue also exists in ClojureScript (which is where we first discovered it).

Steve Miner
April 6, 2018, 4:35 PM

The rejected fix for that protected entryAt from ClassCastException would have fixed this as well. The root of the issue is that the exception can come from checking keys so it makes sense to fix it there. The accepted fix for protected only the = test with the sorted-map first. The more basic key access question was punted. I expect this to work:

I think it's worth taking another look at entryAt. Most users would expect the following to succeed:

If there's a performance concern, then the restriction on testing keys should be documented.

Assignee

Unassigned

Reporter

Daniel Compton

Labels

Approval

None

Patch

None

Affects versions

Priority

Major
Configure