Open respatialized opened 2 years ago
EDIT: Just use :tuple
, which does work since it explicitly describes a collection, eg [:=> [:cat [:tuple :int :int]] :int]
I ran into this just now too:
(defn my-fn [x] 1)
(malli.core/=> my-fn [:=> [:cat [:cat :int :int]] :int])
(malli.instrument/instrument!)
(my-fn [1 2])
; :malli.core/invalid-arity
(my-fn 1 2)
; ------ WARNING - :fn-arity -----------------------------------------------------
; Resource: <eval>:1:1
; Wrong number of args (2) passed to engine/my-fn
; --------------------------------------------------------------------------------
I.e., calling it with two arguments gets past Malli, but triggers normal arity validation.
I also think it's regex min-maxing believing that nesting :cat
doesn't affect the length of the sequence. This isn't true of nested vectors, so maybe it's a more general conceptual issue? One element with two elements in it isn't two elements.
Issue
A function schema produces an error due to overlapping arities when I attempt to use a seqex as the schema for one of the function's input arguments.
Reproducing the bug
Attempting to create the following schema throws an error.
Further information
This error occurs in spite of the fact that the input arities are independently both valid and produce the expected values when used as generators:
@ikitommi suggested that
m/-regex-min-max
might be contributing to the error:Previously reported on the
#malli
channel on the Clojurians Slack.