Skip to content

Commit

Permalink
Remove s/unform call in s/Spec explain*
Browse files Browse the repository at this point in the history
Trying to workaround the following issue, waiting for an actual fix:
  metosin#262

This path prevents throwing the error:

  java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
	at clojure.lang.RT.nthFrom(RT.java:992)
	at clojure.lang.RT.nth(RT.java:940)
	at clojure.spec.alpha$or_spec_impl$reify__2112.unform_STAR_(alpha.clj:1101)
	at clojure.spec.alpha$unform.invokeStatic(alpha.clj:178)
	at clojure.spec.alpha$unform.invoke(alpha.clj:173)
	at clojure.spec.alpha$merge_spec_impl$reify__2190$fn__2193.invoke(alpha.clj:1210)
	at clojure.core$map$fn__5935.invoke(core.clj:2772)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:51)
	at clojure.lang.RT.seq(RT.java:535)
	at clojure.core$seq__5467.invokeStatic(core.clj:139)
	at clojure.core$apply.invokeStatic(core.clj:662)
	at clojure.core$apply.invoke(core.clj:662)
	at clojure.spec.alpha$merge_spec_impl$reify__2190.unform_STAR_(alpha.clj:1210)
	at clojure.spec.alpha$unform.invokeStatic(alpha.clj:178)
	at clojure.spec.alpha$unform.invoke(alpha.clj:173)
	at spec_tools.core.Spec.unform_STAR_(core.cljc:439)
    ...
  • Loading branch information
arichiardi committed Mar 19, 2024
1 parent 7495190 commit c33d692
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spec_tools/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
(let [conformed (s/conform* this x)
[explain? val] (if (s/invalid? conformed)
[(s/invalid? (conform this x)) x]
[true (s/unform spec conformed)])]
[true x])]
(if explain?
(s/explain* (s/specize* spec) path via in val)
[{:path path
Expand Down

0 comments on commit c33d692

Please sign in to comment.