We're updating the issue view to help you get more done. 

Can't define nilable spec on undefined pred

Description

This fails in ClojureScript but works in Clojure:

1 (s/def ::foo (s/cat :bar (s/nilable ::foo)))

Note: While this spec seems silly and is valid for things like [nil], [[nil]], it is just a minimal repro, where larger specs might exhibit a similar shape.

Repro:

1 2 3 4 5 6 7 8 9 10 11 12 13 $ clj -m cljs.main ClojureScript 1.10.339 cljs.user=> (require '[clojure.spec.alpha :as s]) cljs.user=> (s/def ::foo (s/cat :bar (s/nilable ::foo))) Error: Unable to resolve spec: :cljs.user/foo cljs.spec.alpha/reg-resolve! (cljs/spec/alpha.cljs:71:18) cljs$spec$alpha$Specize$specize_STAR_$arity$2 (cljs/spec/alpha.cljs:129:31) cljs$core$IFn$_invoke$arity$2 (cljs/spec/alpha.cljs:124:18) cljs.spec.alpha/specize* (cljs/spec/alpha.cljs:123:1) cljs$core$IFn$_invoke$arity$2 (cljs/spec/alpha.cljs:142:30) cljs.spec.alpha/specize (cljs/spec/alpha.cljs:140:1) cljs$spec$alpha$nilable_impl (cljs/spec/alpha.cljs:1360:15)

Environment

None

Status

Assignee

David Nolen

Reporter

Mike Fikes

Labels

Approval

None

Patch

None

Priority

Blocker