Fork me on GitHub
#clj-kondo
<
2021-12-06
>
dpsutton17:12:08

An error I just caught in a PR (and simplified into obvious small case)

(let [strings (filter string? (range 23))]
  (when strings
    (println "i found strings")))
The intention here is when strings are found, but the empty lazy seq returned from the filter is always truthy. I know clj-kondo has some type-inference going on. Is it possible for it to catch this error?

borkdude18:12:34

@dpsutton It doesn't currently have this but I love that idea.

dpsutton18:12:59

cool. i’ll make an issue then. wasn’t sure if it was something you had enough info to work with at all. glad to know

borkdude18:12:09

I think I saw this issue before in the recent days when I went through all of them, and yes, here it is: https://github.com/clj-kondo/clj-kondo/issues/721 Give it a thumbs up.

👍 1
dpsutton18:12:32

i added the edge case i could think of and a thumbs up. Thanks @borkdude

👍 1