clj-kondo

tomd 2026-01-10T14:09:02.855309Z

I was just looking at the types for the *-in core functions, and noticed that the second arg (which is nearly always a vector in real code) is marked as seqable rather than sequential . I’m pretty sure there isn’t, but can anyone think of legit code where you’d use a seqable but not sequential second arg? The compiler and runtime are happy with these because they are seqable, but they rarely return anything:

(get-in {:a {:b 42}} {:a :b})
;; => nil

(get-in {:a {:b 42}} #{:a :b})
;; => nil

(get-in {:a {:b 42}} ":a:b")
;; => nil
and when they do, it feels like more luck than judgement:
(get-in {:b {:a 42}} #{:a :b})
;; => 42
(that succeeded because the hash order of those set constituents happens to match a valid path in the map) If not, I suggest we tighten up the type to :sequential or :nilable/sequential (thoughts?)

borkdude 2026-01-10T14:10:18.963939Z

Sequential probably makes more sense for clj-kondo

👍 1
tomd 2026-01-10T14:10:50.439809Z

Just found this:

(get-in {\a {\b 42}} "ab")
;; => 42
but likewise, can’t believe anyone actually relies on this

tomd 2026-01-10T14:10:55.337079Z

i’ll make a quick PR

borkdude 2026-01-10T14:11:41.474769Z

we'll see in the regression suite :)

😄 2
tomd 2026-01-10T14:17:49.330379Z

One more, just for anyone reading who likes hideous code 😏 :

(get-in {[:a :b] {[:c :d] 42}} {:a :b :c :d})
;; => 42

👌 1
tomd 2026-01-10T14:39:32.776139Z

regression suite is clear, so feels like a safe change. https://github.com/clj-kondo/clj-kondo/pull/2726