NB this is specifically a problem with spec-alpha2
We'll use the example from the multi-spec example from the tutorial:
(spec2/def :event/type keyword?)
(spec2/def :event/timestamp int?)
(spec2/def :search/url string?)
(spec2/def :error/message string?)
(spec2/def :error/code int?)
(defmulti event-type :event/type)
(defmethod event-type :event/search [_]
(spec2/keys :req [:event/type :event/timestamp :search/url]))
(defmethod event-type :event/error [_]
(spec2/keys :req [:event/type :event/timestamp :error/message :error/code]))
(spec2/def :event/event (spec2/multi-spec event-type :event/type))
;; ⇒ works as expected
(spec2/def :event/event (spec2/multi-spec event-type (fn [val tag] (assoc val :event/type tag))))
;; throws no impl of conform* for PersistentList
;; test case
(gen/sample (spec2/gen :event/event))
Essentially looks like spec2 can't handle retag functions yet, which makes it impossible to spec anything beyond simple maps, sadly.