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

ClassCastException when expounding a map with a sorted-map value #136

Closed
hjrnunes opened this issue Nov 5, 2018 · 2 comments
Closed

ClassCastException when expounding a map with a sorted-map value #136

hjrnunes opened this issue Nov 5, 2018 · 2 comments
Labels

Comments

@hjrnunes
Copy link

hjrnunes commented Nov 5, 2018

when said sorted-map contains any entry with a key other than Keyword:

(require '[expound.alpha :as expound])
(require '[clojure.spec.alpha :as s])

(s/def ::test number?)

(expound/expound ::test {:a 1 :b (into (sorted-map) {:c 2})})
                                                  ;; ^^^ keyword!
;; Works!
-- Spec failed --------------------
...
(require '[expound.alpha :as expound])
(require '[clojure.spec.alpha :as s])

(s/def ::test number?)

(expound/expound ::test {:a 1 :b (into (sorted-map) {"c" 2})})
                                                  ;; ^^^ not keyword!
;; Exception!
java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Keyword

Anything other than Keyword seems to trigger it. Seems to work if sorted-map is top-level.

Hope it helps!
Thanks

@bhb bhb added the bug label Nov 7, 2018
@bhb
Copy link
Owner

bhb commented Nov 7, 2018

@hjrnunes Thanks for reporting this! I can reproduce on my side.

@bhb
Copy link
Owner

bhb commented Dec 15, 2018

@hjrnunes Thanks again for reporting this! This should be fixed in 0.7.2-SNAPSHOT.

@bhb bhb closed this as completed in #143 Dec 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants