`IllegalArgumentException` with `:shrunk` field in custom `IPersistentMap` implementation
After a recent upgrade of Cursive (version 1.13.5 and later), we encountered an issue where tests start to fail with the following error:
Error: java. lang. IllegalArgumentException: No such field :shrunk - that an item isn't found when it doesn't exist
This error occurs when Cursive tries to access the :shrunk field via clojure.lang.RT.get(). The key issue is that we are using a custom implementation of IPersistentMap, which only allows access to a predefined set of keys. The :shrunk field is not part of this set, which causes the error.
This is a Cursive only error, as running lein test doesn't fail.
Steps to Reproduce
- Create a custom implementation of
IPersistentMapthat restricts access to a predefined set of keys. - Run tests in Cursive that involve assertions or other actions that might trigger access to the
:shrunkkey. - See the
IllegalArgumentExceptionwhen Cursive tries to access a non-existent:shrunkfield.
For a minimal reproduction, please refer to the example repository here: Repro Example.
Additional Context
The root cause is detailed in the README within the provided repo. To summarize, Cursive tries to access the :shrunk field, but our custom IPersistentMap does not support this field, leading to an exception. The issue occurs even though the tests pass successfully when run via lein test.