malli
malli copied to clipboard
m/-tuple-transformer is broken in many ways
;; 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).
Since tuples are also defined by their size, is a correct behavior here to no even enter if it's the wrong size?