Open elenam opened 8 years ago
clojure.lang.ExceptionInfo: Call to #'spec-ex.spec-inte/+ did not conform to spec: :: {:clojure.spec/problems {[:args] {:pred number?, :val "", :via [], :in [4]}}, :clojure.spec/args (3 4 6 7 "")} In: [4] val: "" fails at: [:args] predicate: number? :clojure.spec/args (3 4 6 7 "")
Note: the message is "Call to #'spec-ex.spec-inte/+ did not conform to spec:", the rest is data.
Specs for core functions need to be defined before the function is redefined or in a different file.
For nilable predicates the data is:
{:clojure.spec/problems {[:args :check-map :clojure.spec/nil] {:pred nil?, :val :s, :via [], :in [0]},
[:args :check-map :clojure.spec/pred] {:pred map?, :val :s, :via [], :in [0]}}, :clojure.spec/args (:s)}
For some functions, we need to put specs after overwriting them (and we can't get the function name in this case). I think this happens in two cases.