malli

2025-09-16T19:24:59.560709Z

sorry for such a basic question: I’m trying to add malli function schemas to clj-kondo type checking in VSCode. However, when I mc/collect all my custom types get converted to :any - is that a limitation of clj-kondo or does the collect not know about the registry and default to :any for something it doesn’t recognize?

rolt 2025-09-17T09:37:38.457409Z

It could be your setup, in my case for simple types it works. I use a custom registry where I defined {::foo [:re "xxx"]} . If I then define (m/=> foo [::foo :any]) I'm getting the following clj-kondo type: {:arities {1 {:args [:string], :ret :any}}}

rolt 2025-09-17T09:41:13.601829Z

For [:fn xx] types it does fallback to any

rolt 2025-09-17T09:51:29.093799Z

I've just realized that it will convert any :and type to :any instead of trying to interpret any of the operand https://github.com/metosin/malli/blob/master/src/malli/clj_kondo.cljc#L69 It should be easy to fix I'll look into it

rolt 2025-09-18T15:41:26.199659Z

(defmethod malli.clj-kondo/accept :and [_ _ children _]
  (or (some (fn [child] (when (not= :any child) child)) children)
      :any))
with something like this (m/=> foo [:-> [:and :int [:> 6]] :int]) gets typed correctly