metosin / malli

High-performance data-driven data specification library for Clojure/Script.
Eclipse Public License 2.0
1.46k stars 208 forks source link

Malli generates incorrect clj-kondo type spec for tuples #826

Closed divs1210 closed 2 months ago

divs1210 commented 1 year ago
(def location
  [:tuple {:title "location"}
   number? number?])

(m/=> location->str [:=> [:cat location]
                         string?])
(defn location->str [[x y]]
  (str "(" x ", " y ")"))

((requiring-resolve 'malli.clj-kondo/emit!))

(location->str [0 0]) ;; Expected: number, received: vector  
opqdonut commented 1 year ago

This should get fixed by #851

divs1210 commented 2 months ago

Just checked again, this works now! 🎉