malli icon indicating copy to clipboard operation
malli copied to clipboard

m/-tuple-transformer is broken in many ways

Open ikitommi opened this issue 3 years ago • 1 comments

;; ok
(m/decode
  [:tuple string? string?]
  []
  (mt/string-transformer))
; => []

;; fail
(m/decode
  [:tuple keyword? string?]
  []
  (mt/string-transformer))
; => [nil]

;; megafail
(m/decode
  [:tuple string? keyword?]
  []
  (mt/string-transformer))
; =throws=> Execution error (IndexOutOfBoundsException) at malli.core/-update (core.cljc:194).

ikitommi avatar Nov 21 '21 18:11 ikitommi

Since tuples are also defined by their size, is a correct behavior here to no even enter if it's the wrong size?

bsless avatar Dec 08 '21 17:12 bsless