Fork me on GitHub

Running cljs.spec.test.alpha/instrument then cljs.spec.test.alpha/check on fns w/ a namespaced keyword is producing the error: RangeError: Maximum call stack size exceeded. This seems like a bug in Clojurescript. But maybe I’m doing something wrong? I’ve tried on these lib pairs.

org.clojure/clojure       {:mvn/version "1.10.3"}
org.clojure/clojurescript {:mvn/version "1.10.844"}

org.clojure/clojure       {:mvn/version "1.9.0"}
org.clojure/clojurescript {:mvn/version "1.10.339"}
(s/fdef github-deployment->deployment
  :args (s/cat :message (s/keys :req [::github.deployment/payload])))

(defn github-deployment->deployment [{payload ::github.deployment/payload :as message}]

  {:clojure.spec.test.check/opts {:num-tests 1}})

[{:spec #object[cljs.spec.alpha.t_cljs$spec$alpha20390], :clojure.test.check/ret {:result #object[RangeError RangeError: Maximum call stack size exceeded]}, :sym backend.topology.processor.transform.deployment/github-deployment->deployment, :failure #object[RangeError RangeError: Maximum call stack size exceeded]}]


I doubt I can help you solve this, but I assume you've verified that the generator for ::github.deployment/payload works and produces values without encountering that call stack issue?

✔️ 2

No, that’s a great suggestion. I did check that, and I was generating the spec in question. I did find the problem though. A given namespace has to handle messages, all keyed by a :payload entry. When I put a namespace on it… and place it in a file with other specs, it turned out that there was a separate :payload somewhere in the spec tree.