Fork me on GitHub
#core-typed
<
2020-08-21
>
p18:08:02

Hi, when trying out typed.clj/spec I get an exception trying to validate identity:

(s/def ::identity
  #_"Polymorphic type for clojure.core/identity"
  (t/all :binder (t/binder :x (t/bind-tv))
         :body
         (s/fspec :args (s/cat :x (t/tv :x))
                  :ret (t/tv :x))))
:blah.core/identity
blah.core> (s/valid? ::identity identity)
1. Unhandled java.lang.ClassCastException
   class typed.clj.spec.impl$all_impl$reify__6352 cannot be cast to
   class clojure.lang.IFn (typed.clj.spec.impl$all_impl$reify__6352 is
   in unnamed module of loader clojure.lang.DynamicClassLoader
   @29282ff0; clojure.lang.IFn is in unnamed module of loader 'app')
Is typed.clj/spec incompatible with spec1?