clj-kondo 2026-10-21

Hi there! I've tried the new destructuring syntax, clj-kondo works as expected for simple cases. It looks like tho it doesn't go through :analyze-call hooks. I have version 2026.10.20 . Is that a known limitation? I mean from the caller POV, the hook returns a function call. That function call trigger the :type-mismatch on keys!, but not when generated from the :analyze-call hook. The simplified hook:

(defn $ [{:keys [node]}]
  {:node (with-meta
           (api/list-node (rest (:children node)))
           (meta node))})
(defn foo [{:keys! [r-key]}])

(foo {}) ; <- works well
($ foo {}) ; <- does not, specifically for the new destructuring syntax
EDIT: it seems to be working actually.

My mistake, it looks like there's something wrong in my hook, I can't reproduce it with the simplified hook I provided.

By debugging, I found that it's because of the :clj-kondo.impl/generated flag on a new map-node.

(defn foo [{:keys! [r-key]}]
  nil)

(foo {}) ; <- missing required key: :r-key
($ foo {:test []}) ; <- no lint
hook:
; does work as expected
(defn $ [{:keys [node]}]
  (let [[_$-node sym-node map-node & rest-nodes] (:children node)]
    {:node (with-meta
             (api/list-node
              [sym-node
               map-node])
             (meta node))}))

; does NOT work...
(defn $ [{:keys [node]}]
  (let [[_$-node sym-node map-node & rest-nodes] (:children node)]
    {:node (with-meta
             (api/list-node
              [sym-node
               (with-meta
                 (api/map-node (:children map-node))
                 (meta map-node))])
             (meta node))}))

; ...unless the generated flag is removed
(defn $ [{:keys [node]}]
  (let [[_$-node sym-node map-node & rest-nodes] (:children node)]
    {:node (with-meta
             (api/list-node
              [sym-node
               (-> (with-meta
                     (api/map-node (:children map-node))
                     (meta map-node))
                   (dissoc :clj-kondo.impl/generated))])
             (meta node))}))