Skip to content

Commit edf869a

Browse files
puredangerstuarthalloway
authored andcommitted
CLJ-1988 Extend coll-of to handle sequences
Signed-off-by: Stuart Halloway <stu@cognitect.com>
1 parent 5e83c2a commit edf869a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/clj/clojure/spec.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1209,8 +1209,8 @@
12091209
ret
12101210
(assoc ret (nth (if conform-keys cv v) 0) (nth cv 1))))
12111211
identity]
1212-
1213-
(c/or (list? conform-into) (c/and (not conform-into) (list? x)))
1212+
1213+
(c/or (list? conform-into) (seq? conform-into) (c/and (not conform-into) (c/or (list? x) (seq? x))))
12141214
[(constantly ()) addcv reverse]
12151215

12161216
:else [#(empty (c/or conform-into %)) addcv identity]))]

test/clojure/test_clojure/spec.clj

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
coll [] [] nil
144144
coll [:a] [:a] nil
145145
coll [:a :b] [:a :b] nil
146+
coll (map identity [:a :b]) '(:a :b) nil
146147
;;coll [:a "b"] ::s/invalid '[{:pred (coll-checker keyword?), :val [:a b]}]
147148
)))
148149

0 commit comments

Comments
 (0)