Fork me on GitHub

I don't get that behavior


This works fine for example. Even though if you run:

(sgen/generate (s/gen `add))
you get ExceptionInfo Unable to construct gen at: [:a] for: (= (type %) java.lang.Long) clojure.core/ex-info (core.clj:4739)

Alex Miller (Clojure team)00:11:58

when an instrumented fdef with an fspec is checked, the :args spec of the fspec is generated and then the fspec function is invoked to verify it conforms to its spec

Alex Miller (Clojure team)00:11:17

many people find this surprising and I expect we will ultimately change it


what do you think of my suggestion above as a temporary measure (to not call validate-fn when *fspec-iterations* is 0 or nil)?


also, I appreciate that you are considering options for this 🙂


Oh I see, you mean if you spec a higher order function on an fdef. Interesting, I don't think I ever specced one before.