从更大的代码块中精简的重构
clj -Srepro -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-alpha6"}, org.clojure/test.check {:mvn/version "0.10.0-alpha3"}}}'
(require '[clojure.spec.alpha :as s])
(s/def ::m (s/keys :req [::coll]))
(s/def ::coll (s/cat :m (s/? ::m)))
(s/conform ::m {::coll []}) ; => #:user{:coll {}}
(s/exercise ::m) ; => StackOverflowError
与CLJ-2002不同,这里符合工作正常,但生成无限递归。