Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException with :shrunk field in custom IPersistentMap implementation #2966

Closed
evg-tso opened this issue Sep 30, 2024 · 2 comments
Labels
bug Marks issues describing bugs released-eap Marks issues which have had the fixes released in an EAP build
Milestone

Comments

@evg-tso
Copy link

evg-tso commented Sep 30, 2024

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

  1. Create a custom implementation of IPersistentMap that restricts access to a predefined set of keys.
  2. Run tests in Cursive that involve assertions or other actions that might trigger access to the :shrunk key.
  3. See the IllegalArgumentException when Cursive tries to access a non-existent :shrunk field.

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.

image

@cursive-ide cursive-ide added this to the 1.14.0-eap2 milestone Sep 30, 2024
@cursive-ide cursive-ide added the bug Marks issues describing bugs label Sep 30, 2024
@cursive-ide cursive-ide modified the milestones: 1.14.0-eap2, 1.14 Nov 8, 2024
@cursive-ide
Copy link
Owner

Fixed, thanks for the great repro case.

@cursive-ide cursive-ide modified the milestones: 1.14, 1.14.1-eap1 Dec 10, 2024
@cursive-ide
Copy link
Owner

Fix released in 1.14.1-eap1 on 2024-12-11.

@cursive-ide cursive-ide added the released-eap Marks issues which have had the fixes released in an EAP build label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Marks issues describing bugs released-eap Marks issues which have had the fixes released in an EAP build
Projects
None yet
Development

No branches or pull requests

2 participants