Open
Description
Hi there,
I encountered a discrepancy in the behavior of multi-arity schemas in clj vs cljs, seems like a bug.
In the following example, the spec is defined with the documented syntax for multi-arity functions. This fails both in clj and cljs, as expected, so far so good.
(defn myfn-a
{:malli/schema [:function
[:=> [:cat :int :int ] :keyword]
[:=> [:cat :int :int :string] :keyword]]}
([a b] :res1)
([a b c] :res2))
(myfn-a 1 2 3)
The following spec however fails with "invalid function arguments" in clj (expected behavior) and succeeds silently (that is, it doesn't throw any error) in cljs (this is surprising to me).
(defn myfn-b
{:malli/schema [:=> [:cat :int [:? :int] :string] :keyword]}
([a b] :res3)
([a b c] :res4))
(myfn-b 1 2 3)
Metadata
Metadata
Assignees
Type
Projects
Status
No status