metosin / spec-tools

Clojure(Script) tools for clojure.spec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lazy sequence is reversed in coercion

salokristian opened this issue · comments

Library version

0.9.1

Problem

When a lazy seq is given to st/coerce, it is reversed.

Given a coll-of spec

(s/def ::coll-spec (s/coll-of int?))

And a lazy seq as input

(st/coerce ::coll-spec (lazy-seq '(1 2 3)) st/string-transformer)
=> (3 2 1)

The resulting list is reversed.

I can also look into this myself this weekend.

Thanks, I think we fixed that for the 0.9.0 version, but maybe it's a regression or we missed some case.