-
Notifications
You must be signed in to change notification settings - Fork 40
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: Unable to resolve classname: IPersistentMap #24
Comments
You're not really supposed to use data readers to embed foreign objects in your source code. Most of your test case is just distracting fluff: it's easily reproduced with the simple expression #ordered/map ([1 2]) I don't know the details of how the compiler tries to understand map objects embedded in code, which make it come up with this exception, but basically it is just something you're not supposed to do. The tagged syntax is for transporting stuff across the wire, or persisting it to disk. That is, (read-string "#ordered/map ([1 2])") works fine, and that's what the feature is supposed to do. What you're doing is the same as (eval (read-string "#ordered/map ([1 2])")) which fails for a lot of reader-tagged objects. Do you have some compelling reason that you need this to work? I have trouble imagining a way in which the answer could be yes. |
I understand now that use of reader-tagged objects in bare code is not something that you want to do typically. I encountered this error in code that embedded an ordered map in metadata while passing through a couple layers of macros. Switching away from an ordered map to a regular map made the issue go away. My best guess after finding out that I could trigger the error with I was able to fix this issue by fully-qualifying interfaces and protocols in |
Here's a failing testcase for
map_test.clj
:This blows up with the error message in the issue title.
If I change code in
map.clj
to fully-qualify all instances ofIPersistentMap
, then the error message changes to "java.lang.IllegalArgumentException: No matching field found: backing-map for class flatland.ordered.map.OrderedMap".My clojure-fu is not skillful enough to unwind your
delegating-deftype
macro, so I thought I'd ask here and see if you know what's going on.Thanks!
The text was updated successfully, but these errors were encountered: