How can (set) throw a ClassCastException?
ClassCastException
class clojure.lang.PersistentHashMap cannot be cast to class java.util.Map$Entry (clojure.lang.PersistentHashMap is in unnamed module of loader 'app'; java.util.Map$Entry is in module java.base of loader 'bootstrap')
Code:
(->> (data/diff foo bar)
(take 2)
(mapcat keys)
(set))
Stacktrace points to the line where (set) is called:
`clojure.lang.APersistentMap$KeySeq` in `first`
`clojure.lang.RT` in `first` at line `692`
`clojure.core$first__5449` in `invokeStatic` at line `55`
`clojure.core$reduce1` in `invokeStatic` at line `946`
`clojure.core$set` in `invokeStatic` at line `4115`
`clojure.core$set` in `invoke` at line `4107`
Clojure version:
[org.clojure/clojure "1.11.2"]