Fork me on GitHub
#clj-kondo
<
2021-10-19
>
jumar07:10:30

I've just found a serious bug in our production code using something like (rseq (map ... This fails because rseq doesn't work on lazy seqs but requires a vector or a sorted map

(rseq (map inc (range 10)))
;;=>
Execution error (ClassCastException) at ...
clojure.lang.LazySeq cannot be cast to clojure.lang.Reversible 
Is this something that clj-kondo could warn against? I understand that this is not a prevalent use case just wondering if that's possible or desirable.

borkdude07:10:23

Yes, clj-kondo has a type system which can be used for this. We just need to add the types for rseq

borkdude07:10:39

Feel free to make an issue