Repro:
(s/def :test/foo number?)
(s/def :test/bar string?)
(s/def :test/baz (s/and number? pos?))
(s/def :test/spec
(s/keys :req-un [:test/foo]
:opt-un [:test/baz]))
(s/def :test/spec-with-or
(s/keys :req-un [(or :test/foo :test/bar)]
:opt-un [:test/baz]))
;; this works as expected
(lens/get {:foo -1 :baz 1} :test/spec :foo)
;;=> -1
;; but this doesn't work
(lens/get {:foo -1 :baz 1} :test/spec-with-or :foo)
;; Unhandled java.lang.ClassCastException
;; class clojure.lang.PersistentList cannot be cast to class clojure.lang.Named
;; (clojure.lang.PersistentList and clojure.lang.Named are in unnamed module of
;; loader 'app')
Repro: