athos / Pinpointer

Pinpointer is yet another clojure.spec error reporter based on a precise error analysis
Eclipse Public License 1.0
94 stars 3 forks source link

(pinpoint (s/coll-of <predicate>) <input>) fails #5

Open athos opened 6 years ago

athos commented 6 years ago
=> (pinpoint (s/coll-of integer?) [:foo])
[PINPOINTER] Failed to analyze the spec errors, and will fall back to s/explain-printer

In: [0] val: :foo fails predicate: integer?
nil
=> (pinpoint (s/coll-of integer?) [:foo] {:fallback-on-error false})

IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol  clojure.lang.RT.seqFrom (RT.java:550)
=> 

This is due to CLJ-2168. A workaround for the issue is to wrap the predicate in s/spec:

=> (pinpoint (s/coll-of (s/spec integer?)) [:foo])
Detected 1 spec error:
----------------------------------------------------------------------
(1/1)

    Input: [:foo]
            ^^^^ 
 Expected: integer?

----------------------------------------------------------------------
nil
=>