Welcome! Please see the About page for a little more info on how this works.

0 votes
in Spec by

(deftype MySpec []
(conform* [_ x]


(s/def ::x (MySpec.))

(s/explain ::x :foo)

This will fail with a "Unable to resolve spec: :user/x" exception, but the {{def}} succeeded. Switching the deftype to defrecord fixes the problem.

Cause: The {{with-name}} function has cond options for ident?, regex?, and IObj. If none of these succeed, there is no fallthrough case and the s/def will silently return nil.

Proposed: Throw an error in the fallthrough case.

Patch: clj-2135.patch

1 Answer

0 votes
Reference: https://clojure.atlassian.net/browse/CLJ-2135 (reported by thheller)