Issue with spec-ing higher-order functions; clojure.lang.AFunction$1 cannot be cast to clojure.lang.MultiFn

2019-01-17 Thread Josip Gracin
Hi! The following test throws an exception when run using "lein test" and I can't figure out why. (ns issue (:require [clojure.test :as t] [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as st])) (s/fdef ::boolean-supplier :args (s/cat) :ret boolean?) (def

Re: Issue with spec-ing higher-order functions; clojure.lang.AFunction$1 cannot be cast to clojure.lang.MultiFn

2019-01-17 Thread Alex Miller
Your boolean-supplier should be: (s/def ::boolean-supplier (s/fspec :args (s/cat) :ret boolean?)) On Thursday, January 17, 2019 at 6:38:44 AM UTC-6, Josip Gracin wrote: > > Hi! > > The following test throws an exception when run using "lein test" and I > can't figure out why. > > (ns

Re: Issue with spec-ing higher-order functions; clojure.lang.AFunction$1 cannot be cast to clojure.lang.MultiFn

2019-01-17 Thread Josip Gracin
Thanks! I understand why my version is incorrect. However, I get the same error with the corrected spec. On Thursday, January 17, 2019 at 3:26:24 PM UTC+1, Alex Miller wrote: > > Your boolean-supplier should be: > > (s/def ::boolean-supplier > (s/fspec > :args (s/cat) > :ret boolean?)

Re: Issue with spec-ing higher-order functions; clojure.lang.AFunction$1 cannot be cast to clojure.lang.MultiFn

2019-01-17 Thread Alex Miller
The modified version works for me, so not sure what you're seeing. $ clj Clojure 1.10.0 user=> (ns issue (:require [clojure.test :as t] [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as st])) nil issue=> (s/def ::boolean-supplier (s/fspec :args (s/cat)

Re: Issue with spec-ing higher-order functions; clojure.lang.AFunction$1 cannot be cast to clojure.lang.MultiFn

2019-01-17 Thread Josip Gracin
Thanks! I've created an issue in Leiningen tracker (https://github.com/technomancy/leiningen/issues/2524) because it might have to do with it. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.c