This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-16
Channels
- # aws-lambda (10)
- # beginners (52)
- # boot (42)
- # cider (2)
- # cljs-dev (8)
- # cljsjs (4)
- # cljsrn (10)
- # clojars (3)
- # clojure (48)
- # clojure-conj (4)
- # clojure-dev (19)
- # clojure-italy (7)
- # clojure-norway (4)
- # clojure-russia (44)
- # clojure-spec (70)
- # clojure-uk (34)
- # clojurescript (39)
- # cursive (35)
- # data-science (11)
- # datomic (7)
- # emacs (6)
- # fulcro (2)
- # hoplon (12)
- # jobs (1)
- # juxt (18)
- # lein-figwheel (2)
- # leiningen (4)
- # luminus (9)
- # off-topic (29)
- # om (46)
- # onyx (131)
- # other-languages (24)
- # parinfer (84)
- # pedestal (10)
- # portkey (45)
- # protorepl (1)
- # re-frame (15)
- # reagent (43)
- # ring-swagger (41)
- # schema (6)
- # shadow-cljs (293)
- # slack-help (2)
- # specter (42)
CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/defn did not conform to spec:
In: [2] val: :clojure.spec.alpha/invalid fails spec: :clojure.core.specs.alpha/defn-args at: [:args :bs :arity-1 :body :prepost+body :prepost] predicate: map?
In: [2] val: :clojure.spec.alpha/invalid fails spec: :clojure.core.specs.alpha/defn-args at: [:args :bs :arity-1 :body :body] predicate: any?
#:clojure.spec.alpha{:problems ({:path [:args :bs :arity-1 :body :prepost+body :prepost], :pred clojure.core/map?, :val :clojure.spec.alpha/invalid, :via [:clojure.core.specs.alpha/defn-args], :in [2]} {:path [:args :bs :arity-1 :body :body], :pred clojure.core/any?, :val :clojure.spec.alpha/invalid, :via [:clojure.core.specs.alpha/defn-args], :in [2]}), :spec #object[clojure.spec.alpha$regex_spec_impl$reify__1188 0x568c2ec6 "clojure.spec.alpha$regex_spec_impl$reify__1188@568c2ec6"], :value (foo [] :clojure.spec.alpha/invalid), :args (foo [] :clojure.spec.alpha/invalid)}, compiling:(/Users/erik/Documents/telenordigital.com/di-data-inventory/src/data_inventory/handler.clj:41:1)
::spec/invalid
is a sentinel value used internally by spec. I think you're just not ever supposed to use it as a value.
you can work around that error with something like (defn foo [] (identity ::spec/invalid))
@hiredman fair enough that I can't spec the return value, but I would like to be able to define it, I mean the function is perfectly valid as such.
::spec/invalid is not a valid spec value, and spec is used to verify macro expansions, so
@favila: yes, the problem arises from
(spec/conform any? ::spec/invalid)
;; => :clojure.spec.alpha/invalid
We have conformer functions that return ::s/invalid
but you do have to be a bit careful about how/when you do so.